This feature is not Baseline because it does not work in some of the most widely-used browsers.
The error data property of a SuppressedError instance contains a reference to the error that results in the suppression.
Any value. Like cause, you cannot assume it's an Error instance, although it usually is the case.
Property attributes of SuppressedError: error
| |
|---|---|
| Writable | yes |
| Enumerable | no |
| Configurable | yes |
try {
throw new SuppressedError(
new Error("New error"),
new Error("Original error"),
"Hello",
);
} catch (e) {
console.log(e.error); // Error: "New error"
}
| 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 | |
error |
134 | 134 | 141 | 119 | No | 134 | 141 | 88 | No | 29.0 | 134 | No | 1.0.23 | No | No |
© 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/error