I know I can register a callback for JavaScript errors, like this:
window.onerror = function(message, url, line) {
// ...
};
However, I'd also like to be notified of any other error that's being logged to the console, such as images that couldn't be loaded (HTTP status code 404) or any other HTTP request with a bad status code such as 500.
Is that possible, and if yes, how? Note that I only intend to use this for debugging purposes, so it doesn't matter if the solution only works in Chrome.