Answer the question
In order to leave comments, you need to log in
Why is the error handler not working?
Is there a way to globally catch the error so that it doesn't get thrown to the console?
Suppose.
Several files with scripts are included on the page.
Each file has different errors.
If you prescribe before any scripts
window.onerror = function(message, source, lineno) {
alert("Ошибка:"+message +"\n" +
"файл:" + source + "\n" +
"строка:" + lineno);
};
Answer the question
In order to leave comments, you need to log in
Check by code: is there a redefinition of the onerror global event somewhere inside the code and is all the necessary code in a try-catch?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question