• In JS an error can be any arbitrary value. This function converts an unknown error to an Error and stores the original value in the error object.

    Parameters

    • error: unknown

      The error to convert.

    Returns Error

    An Error.