2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

Improve error handling

This commit is contained in:
Nick Uraltsev
2016-06-13 13:56:08 -07:00
parent 120e8f5557
commit 91dae3c4ad
14 changed files with 120 additions and 41 deletions
+3 -3
View File
@@ -20,13 +20,13 @@
'<strong>' + person.name + '</strong>' +
'<div>Github: <a href="https://github.com/' + person.github + '" target="_blank">' + person.github + '</a></div>' +
'<div>Twitter: <a href="https://twitter.com/' + person.twitter + '" target="_blank">' + person.twitter + '</a></div>' +
'</div>' +
'</div>' +
'</li><br/>'
);
}).join('');
})
.catch(function(data) {
document.getElementById('people').innerHTML = '<li class="text-danger">' + data + '</li>';
.catch(function (err) {
document.getElementById('people').innerHTML = '<li class="text-danger">' + err.message + '</li>';
});
</script>
</body>
+2 -2
View File
@@ -29,9 +29,9 @@
output.className = 'container';
output.innerHTML = res.data;
})
.catch(function (res) {
.catch(function (err) {
output.className = 'container text-danger';
output.innerHTML = res.data;
output.innerHTML = err.message;
});
};
})();
+2 -2
View File
@@ -37,9 +37,9 @@
output.className = 'container';
output.innerHTML = res.data;
})
.catch(function (res) {
.catch(function (err) {
output.className = 'container text-danger';
output.innerHTML = res.data;
output.innerHTML = err.message;
});
};
})();