Check If File Exists But Prevent 404 Error in Console from Showing Up

Check if file exists but prevent 404 error in console from showing up

Seems like the answer is: No. Can't avoid getting a 404 error in the console unless you kick off a call to a server-side script to check file existence.

Check if file exists but prevent 404 error in console from showing up

Seems like the answer is: No. Can't avoid getting a 404 error in the console unless you kick off a call to a server-side script to check file existence.

Angular2: 404 exception handling

The error line is produced by the browser. There is nothing you can do about it.

As workaround you could create an API on the server that doesn't respond with 404 (or any other error code) when requested file doesn't exist, and then handle the alternative error response in Angular code.

Prevent image load errors going to the javascript console

Sorry there is seemingly no way to suppress that error, at least in Google Chrome.

See also: Check if file exists but prevent 404 error in console from showing up

Angular suppress 404 in console when using fallback?

Pankaj Pakar pretty much answered it, after much googling it seems that this is not possible currently. Closing.



Related Topics



Leave a reply



Submit