• Creates a GenericError from an RTK Query error for well-known fetch failures.

    Handles both GenericError (from custom baseQuery error responses) and SerializedError (from unexpected JS errors during the fetch).

    Parameters

    • Optionalerror: unknown

      The error from RTK Query dispatch result, or undefined if no response

    Returns GenericError

    The original GenericError if already one, or a new GenericError with type 'wellknown_error'