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

    This follows the established pattern in the codebase for converting RTK Query errors to the SDK's GenericError type with type: 'wellknown_error'.

    Parameters

    • Optionalerror: FetchBaseQueryError | SerializedError

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

    Returns GenericError

    A GenericError with type 'wellknown_error'

    const { data, error } = await store.dispatch(
    wellknownApi.endpoints.configuration.initiate(url)
    );

    if (error || !data) {
    const genericError = createWellknownError(error);
    log.error(genericError.message);
    throw new Error(genericError.message);
    }