I am building a SignIn component in ReactJS. So I have a standard Axios post request to signin a user:
try {
// Authenticate against NodeJS
const res = await axios.post(`${API_URL}/auth/signin`, {
email: this.state.email,
password: this.state.password
});
...
} catch (err) {
// I don't want to display anything to the client;
}
If I want to, I can successfully catch the error on an incorrect password (401 error). However in this case I do not want to display anything on the client browser's console. The problem is that Axios (even with Fetch) does not care about the catch and still displays its own XHR error:
Is there a way to prevent these type of errors from appearing in the console?