# Misc Web Globals

> The DOMException and PromiseRejectionEvent globals and the global rejection events.

`DOMException` and `PromiseRejectionEvent` are globals and follow the
[WebIDL](https://webidl.spec.whatwg.org/#idl-DOMException) and
[HTML](https://html.spec.whatwg.org/multipage/webappapis.html#promiserejectionevent) standards, including legacy
`DOMException` codes and constants such as `DOMException.ABORT_ERR`.

## Promise rejection events

Elide dispatches `unhandledrejection` on `globalThis` when a Promise rejects without a handler, and
`rejectionhandled` when a handler is attached later. `onunhandledrejection` and `onrejectionhandled` also work.

```js
globalThis.addEventListener("unhandledrejection", (event) => console.error(event.reason));
```
