@ac-essentials/misc-util
    Preparing search index...

    Function jsonSerializeError

    • Serialize an Error object to a JSON-compatible format.

      The function extracts standard properties like name, message, stack, and cause, as well as any enumerable own properties of the error object.

      If the error is an AggregateError, it also serializes the errors property.

      Type Parameters

      • T extends Error

      Parameters

      • error: T

        The Error object to serialize.

      • Optionalreplacer: JsonReplacer

        An optional replacer function to customize the serialization of values.

      Returns JsonError

      A JSON representation of the error.