Function formatErrorToString

  • Formats an error object into a string representation.

    Parameters

    • error: unknown

      The error to format. It can be an Error instance, a string, or another object.

    • Optional defaultErrorString: string = ''

      The default error message if the error cannot be formatted.

    • Optional opts: {
          errorLimit: number;
      } = ...

      Additional options.

      • errorLimit: number

        The maximum number of stack trace lines to include.

    Returns string

    The formatted error message.