Backstage
    Preparing search index...

    Function toError

    • Converts an unknown value to an ErrorLike object.

      If the value is already an ErrorLike object, it is returned as-is. If the value is a string, a new Error is created with that string as the message. For all other values, a new Error is created with a message of the form unknown error '<stringified>'.

      Parameters

      • value: unknown

        an unknown value

      Returns ErrorLike

      an ErrorLike object