Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to prevent 403 errors from logging to the web console?

I have some js/html/css that will in certain situations, encounter harmless 403 errors when loading images.

Is there any way to catch these errors and to prevent them from logging errors to the console?

Thanks!

like image 622
asutherland Avatar asked Aug 09 '13 19:08

asutherland


1 Answers

Nope. If the server responds with just about anything other than a 200, you are going to see it in the console. You will need to fix it on the server side.

Also, 403 errors are far from meaningless - it literally means that there are "Forbidden" requests going out. While it may be "meaningless" to the functionality/content of your app/site, those requests should either 1) not be requested in the first place, or 2) be responded to with some sort of "Forbidden" placeholder image.

like image 183
Ryan Wheale Avatar answered Nov 15 '22 13:11

Ryan Wheale