Catch all unhandled javascript promise rejections

The whole world is waiting for the unhandledrejection and rejectionhandled events. As of March 2016, Chrome is now the first to support it.

Example:

window.addEventListener('unhandledrejection', function(event) {
    console.error('Unhandled rejection (promise: ', event.promise, ', reason: ', event.reason, ').');
});

Specification: HTML Living Standard

Mozilla Developer:
onrejectionhandled, onunhandledrejection

Chromium Issues: 495801, 393913

Leave a Comment