SuppressedError: suppressed
Baseline Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The suppressed data property of a SuppressedError instance contains a reference to the original error that got suppressed because a new error was generated while handling it.
Value
Any value. Like cause, you cannot assume it's an Error instance, although it usually is the case.
Property attributes of SuppressedError: suppressed
| |
|---|---|
| Writable | yes |
| Enumerable | no |
| Configurable | yes |
Examples
Using suppressed
try {
throw new SuppressedError(
new Error("New error"),
new Error("Original error"),
"Hello",
);
} catch (e) {
console.log(e.suppressed); // Error: "Original error"
}
Specifications
Browser compatibility
| Desktop | Mobile | Server | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on iOS | Samsung Internet | WebView Android | WebView on iOS | Bun | Deno | Node.js | |
suppressed |
134 |
134 |
141 |
119 |
preview |
134 |
141 |
88 |
No |
29.0 |
134 |
No |
1.0.23 |
2.2.10 |
No |
See also
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SuppressedError/suppressed