Function getErrorStack

  • Internal

    Get the error stack from a value. If the value is an error, the error's stack is returned. Otherwise, it returns undefined.

    Returns

    The error stack, or undefined if the value is not an error.

    Parameters

    • Optional error: unknown

      The value to get an error stack from.

    Returns undefined | string