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).
Optional
The error from RTK Query dispatch result, or undefined if no response
The original GenericError if already one, or a new GenericError with type 'wellknown_error'
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).