admin管理员组

文章数量:1289881

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!

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!

Share Improve this question asked Aug 9, 2013 at 19:15 asutherlandasutherland 2,9694 gold badges38 silver badges51 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 12

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 typically far from "harmless"- 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 handled by your app to let the user know they don't have permission.

本文标签: javascriptPossible to prevent 403 errors from logging to the web consoleStack Overflow