2

I try to catch error 400 bad request like this:

catch((error: any) => {
    if (error.status === 500) {
        return Observable.throw(new Error(error.status));
    }
    else if (error.status === 400) {
        console.log( 'error' );
        return Observable.throw(new Error(error.status));
    }

but it still appears like this in the console: enter image description here

Do you have any idea how to fix this problem or remove this message on console?

Thanks a lot.

Hugues M.
  • 19,846
  • 6
  • 37
  • 65

1 Answers1

-2

This is the browser's standard behavior and cannot be influenced by you or Angular.

If you get those messages a lot and it clutters your console whilst developing, you can filter the console. This is how you would do it in Chrome: filter network errors in chrome

see also https://stackoverflow.com/a/14427545/4694994

Kim Kern
  • 54,283
  • 17
  • 197
  • 195