ErrorSerialization
Options controlling how errors are converted into SerializedError.
Properties
Section titled “Properties”aggregated?
Section titled “aggregated?”
optional
aggregated:boolean
Include AggregateError.errors
array serialization.
cause?
Section titled “cause?”
optional
cause:boolean
Include the error.cause
property in serialization.
hook()?
Section titled “hook()?”
optional
hook: (err
,depth
) =>SerializedError
Hook invoked after serializing each error node. Allows post-processing or filtering of the SerializedError.
Parameters
Section titled “Parameters”The freshly built SerializedError.
number
Current recursion depth (0 = root).
Returns
Section titled “Returns”Possibly modified SerializedError.
maxDepth?
Section titled “maxDepth?”
optional
maxDepth:number
Maximum recursion depth when traversing nested causes or aggregates.
stack?
Section titled “stack?”
optional
stack:boolean
Include the error.stack
string in the output.