Created
October 17, 2017 07:28
-
-
Save jayphelps/72dc650d56bb7714cc08b402b4b8a28f to your computer and use it in GitHub Desktop.
in situations like tc39 Observable when it should "swallow" errors, but we still want to report them to window.onerror (HostReportErrors) and in the console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dispatchSwallowedError(e) { | |
window.dispatchEvent(new ErrorEvent('error', { | |
error: e, | |
message: e.message | |
})); | |
console.error(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment