Serializes any thrown value to a plain, serializable object.
An Error yields { name, message, stack?, cause?, classifiers?, errors? }
with the cause chain followed to a bounded depth. Safe scalar driver
classifiers are copied from a fixed allowlist; AggregateError members are
copied under bounded width and total-node budgets. A non-Error value (a
string, a number, a plain object) yields { name: 'Error', message: <stringified> } — the same shape, so a caller can always read name and
message without narrowing.
Serializes any thrown value to a plain, serializable object.
An
Erroryields{ name, message, stack?, cause?, classifiers?, errors? }with thecausechain followed to a bounded depth. Safe scalar driver classifiers are copied from a fixed allowlist;AggregateErrormembers are copied under bounded width and total-node budgets. A non-Errorvalue (a string, a number, a plain object) yields{ name: 'Error', message: <stringified> }— the same shape, so a caller can always readnameandmessagewithout narrowing.