SuppressedError: error

The error data property of a SuppressedError instance contains a reference to the error that results in the suppression.

Value

Any value. Like cause, you cannot assume it's an Error instance, although it usually is the case.

Property attributes of SuppressedError: error
Writableyes
Enumerableno
Configurableyes

Examples

Using error

js
try {
  throw new SuppressedError(
    new Error("New error"),
    new Error("Original error"),
    "Hello",
  );
} catch (e) {
  console.log(e.error); // Error: "New error"
}

Specifications

No specification found

No specification data found for javascript.builtins.SuppressedError.error.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility

See also