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:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
};
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user