Is there a way to console(.)error an error without it stopping the code. Like a global try/catch
2 Answers
You can use the window.onerror event handler as a global event handler and write something like:
window.onerror = function myErrorHandler(error, url, lineNumber) {
logger("error has occured = " + error);
return false;
}
you can read more about it here:
https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror
1 Comment
RandomWeeb315
This is for web.
console.errordoesn't stop code