W3cubDocs

/Web APIs

WindowEventHandlers.onrejectionhandled

The onrejectionhandled property of the WindowEventHandlers mixin is the event handler for processing rejectionhandled events. These events are raised when Promises are rejected.

Syntax

window.addEventListener("rejectionhandled", function(event) { ... });
window.onrejectionhandled = function(event) { ...};

Example

window.onrejectionhandled = function(e) {
  console.log(e.reason);
}

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
onrejectionhandled
49
79
69
68
55
This event handler was added in Firefox 55 but was disabled since it wasn't fully implemented. It was fully implemented in Firefox 68 and enabled by default in Firefox 69.
No
36
11
49
49
68
55
This event handler was added in Firefox 55 but was disabled since it wasn't fully implemented. It was fully implemented in Firefox 68 but not enabled by default.
No
11.3
5.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onrejectionhandled