I have error hiding system from the console using try/catch in many places in my code. Example:
try {
//code with error
}
catch(e){
//do nothing
}
Now I'm adding debug mode to my program and I want absolutely all errors to be logged to the console, including those that are handled by the above construction. The easiest way is to add some debugPrint func, where DEBUG env var will be checked, inside every catch, but I'm searching for the shortest way. I tried to add error event listener to window, but this doesn't work. Are there any similar solutions?