Skip to content

ErrorSerialization

Options controlling how errors are converted into SerializedError.

optional aggregated: boolean

Include AggregateError.errors array serialization.


optional cause: boolean

Include the error.cause property in serialization.


optional hook: (err, depth) => SerializedError

Hook invoked after serializing each error node. Allows post-processing or filtering of the SerializedError.

SerializedError

The freshly built SerializedError.

number

Current recursion depth (0 = root).

SerializedError

Possibly modified SerializedError.


optional maxDepth: number

Maximum recursion depth when traversing nested causes or aggregates.


optional stack: boolean

Include the error.stack string in the output.