we should probably also check for the existence of `window.onerror` and then call it as well