-
Notifications
You must be signed in to change notification settings - Fork 163
Closed
Description
Promise rejection events can be caught via the window.onunhandledrejection
event. If an exception is thrown during processing of a Promise (either during its initial execution phase or during processing a "then" function attached to it), the Promise is rejected and the "reason
" entry in the rejection event will be an Error
. reason
may also be any other type, as it will be populated with whatever argument is given in calls to the reject
function of the Promise handler, so will need to be checked before handling. I'm not sure how TraceKit should behave if it catches an unhandled rejection that is not an Error
.
Support for this feature of Promises isn't great yet, but is improving (see http://caniuse.com/#feat=unhandledrejection).
Metadata
Metadata
Assignees
Labels
No labels