custom-error-definition
: Enforce standard error constructors when subclassing (message, options)
#1810
Labels
custom-error-definition
: Enforce standard error constructors when subclassing (message, options)
#1810
Description
Error#cause
was recently added and the native way (Node 16.9+) to set this property is via the options parameter:When subclassing Error, this parameter can be lost or simply use a different format.
This is a companion rule to #1342
cause
when creating Errorscause
(and more generally anoptions
object as second parameter) when subclassing errorsFail
Pass
The text was updated successfully, but these errors were encountered: