Ignoring specific JS errors by matching text

In my host file and ad unit, I have a domain and a file that should be ignored by my computer - to prevent some problems (I ignore api.mixpanel.com so as not to start tracking on my local machine, m ignoring print.css at all sites, because Chrome for some reason puts it on the screen, as well as on print media). The problem is that they cause 2 default JS errors, as shown in the following screenshot:

Screenshots of errors

This is pretty useless, and it bothers me when I sometimes encounter JS errors. Is there a way to match, for example, /^GET (.+)/print\.css$/i and not include it in the error log on the Chrome console? Or would it be a better solution to just find the code where he calls them and try / catch there?

+4
source share
1 answer

As far as I can tell, no. Moreover, these two errors in the console are not Javascript errors, but are resource errors (Chrome could not access the two resources).

However, you can filter what you see on the console .

0
source

Source: https://habr.com/ru/post/1484351/


All Articles