Reputation: 177
Based on axios docs, I have the catch block after my request, but even I catching the error and showing the Alert, on browsers console I got the message:
POST http://localhost:5000 403 (Forbidden) spread.js:25
Why the message above ? Is this the default browser behavior ?
Client:
axios.get('/user?ID=12345')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
alert(error);
});
Server:
res.status(403).send('Error message');
Upvotes: 1
Views: 1815