Description
Refs: whatwg/html#1196
The following API was suggested for HTML:
self.reportError(ex); // reports an exception - HTML's "report the error"
// Typically, beforehand to invoke an uncaught exception users did/do:
setTimeout(() => { throw e; }, 0);
From the top of my head, some people with opinions on these topics:
cc @ronag @mcollina @jasnell @Linkgoron @addaleax from Node.js
cc @annevk @domenic from whatwg about whether or not this makes sense from that angle
cc @benlesh for general interesting feedback and a library author PoV and for suggesting this
One big consideration here is that Node.js error handling model is different, if reportError
does setTimeout(() => { throw e; }, 0);
it's less a "report an error" and more a "crash the process with this uncauight exception".
One upside is that this API can let us provide better developer experience than a throw
in a setTimeout
since we can (in theory) preserve the stack and more information about the error state.
Activity