The PromiseRejectionEvent interface represents events which are fired when JavaScript Promises are rejected. These events are particularly useful for telemetry and debugging purposes.
The PromiseRejectionEvent() constructor returns a newly created PromiseRejectionEvent, which represents events fired when a JavaScript Promise is rejected.
The PromiseRejectionEvent.promise read-only property indicates the JavaScript Promise which has been rejected. You can examine the event's PromiseRejectionEvent.reason property to learn why the promise was rejected.
The PromiseRejectionEvent.reason read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). This in theory provides information about why the promise was rejected.
The Window.onrejectionhandled property is an event handler for processing rejectionhandled events, which are raised when Promises are rejected.
The Window.onunhandledrejection property is an event handler for processing unhandledrejection events, which are raised for unhandled Promise rejections.