People often hook on window.onerror to log exceptions to the server. @domenicproposed native promises call window.onerror on unhandled rejections just like exceptions.
Align with the proposed API for the web.
Bluebird remains a drop-in replacement for ES6 promises if the spec is approved with a more feature rich API.
Hook with tooling used to debug on the client.
Promise.onPossiblyUnhandledRejection is already exposed allowing this, in the next version we might fire an event to process from all promises possibly rejected. It's already overridable.
API is not approved yet.
Add complexity to the library and more browser/node specific logic.
We have observed people treat onPossiblyUnhandledRejection in many different ways, some suppress it, some make it throw and some make it perform custom logic. This indicates not everyone treats these as errors.
I'm not aware of any other promise libraries considering this at the moment.
The text was updated successfully, but these errors were encountered:
I am not sure a separate issue is needed, whatever events we do on process in node will be done on window in browser. However, onerror is bad because we won't be using the equivalent in node (onUncaughtException) and its signature is very different.