Interface AssertMakeErrorOptions

interface AssertMakeErrorOptions {
    cause?: Error;
    errorName?: string;
    errors?: Error[];
    sanitize?: boolean;
}

Properties

cause?: Error

Discloses the error that caused this one, typically from a lower layer of abstraction. This is represented by a public cause data property on the error, not a hidden annotation.

errorName?: string

Does not affect the error.name property. That remains determined by the constructor. Rather, the errorName determines how this error is identified in the causal console log's output.

errors?: Error[]

Normally 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.

sanitize?: boolean

Defaults to true. If true, makeError will apply sanitizeError to the error before returning it. See the comments on sanitizeError.