Skip to content

Function: createApiError()

ts
function createApiError(
   message, 
   status, 
   statusText, 
   body, 
   headers?, 
   options?): ApiError;

Defined in: src/core/errors/fromResponse.ts:102

Build the error class that matches the status, so callers can branch on the type instead of the number.

Parameters

ParameterType
messagestring
statusnumber
statusTextstring
bodyunknown
headers?Headers
options?ApiErrorOptions

Returns

ApiError