MDN states the following:
some/many
error
events do not triggerwindow.onerror
, you have to listen for them specifically
That's great, but which ones do not invoke onerror
?
Introduction. onerror is a DOM event handler. It is started when an error occurs during object loading. While window. onerror is an event handler, there is no error event being fired: instead, when there is an uncaught exception or compile-time error, the window.
The onerror event is triggered if an error occurs while loading an external file (e.g. a document or an image). Tip: When used on audio/video media, related events that occurs when there is some kind of disturbance to the media loading process, are: onabort. onemptied. onstalled.
The Error object and error. It contains 3 standardized properties: message, fileName, and lineNumber.
The onerror attribute fires when an error occurs while loading an external file (e.g. a document or an image).
It looks like quirksmode has a good detail of what errors it will and will not catch: http://www.quirksmode.org/dom/events/error.html
If it helps, any error that you specifically throw
will be caught.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With