MDN self-hosted library · e01.org

SuppressedError: suppressed

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.

Open notebook · 1 cells javascript-instance-data-property upstream source

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.

0

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

See also