OptionalcauseOptionalerrorDoes not affect the error.name property. That remains determined by
the constructor. Rather, the errorName determines how this error is
identified in an associated console's output.
OptionalerrorsNormally only used when the ErrorConstuctor is AggregateError, to
represent the set of prior errors aggregated together in this error,
typically by Promise.any. But makeError allows it on any error.
This is represented by a public errors data property on the error,
not a hidden annotation.
OptionalsanitizeDefaults to true. If true, makeError will apply sanitizeError
to the error before returning it. See the comments on
sanitizeError.
Discloses the error that caused this one, typically from a lower layer of abstraction. This is represented by a public
causedata property on the error, not a hidden annotation.