← Back to release summary

Error.cause property

Category
JavaScript
Type
Chromium catches up
Status
Enabled by default (Chrome 93)
Intent stage
Shipped

Summary

Adds an additional options parameter to the Error() constructor with a cause property, the value of which will be assigned to the error instances as a property. This allows errors to be chained without unnecessary and overelaborate formalities on wrapping the errors in conditions.

Standards & signals

View on chromestatus.com