jsonMakeErrorReplacerFunction
jsonMakeErrorReplacerFunction(
replacer?):JsonReplacerFunction
Defined in: packages/core/src/json/replacers/error.ts:37
Create a JSON replacer function that converts Error objects into plain objects containing their non-enumerable properties (name, message, stack, cause, etc.) along with any enumerable properties.
This function can be used as a base replacer to ensure that Error objects are properly serialized during JSON serialization, and can be combined with a user-defined replacer for additional customization.
Parameters
Section titled “Parameters”replacer?
Section titled “replacer?”An optional user-defined replacer (function or property list) to apply after the Error replacer.
Returns
Section titled “Returns”A JSON replacer function that handles Error objects and applies the user-defined replacer if provided.