fn
createFetchError
v0.0.1Builds a FetchError from a FetchContext, extracting URL, status, and error message
Signature
ts
export function createFetchError<T = unknown, R extends ResponseType = ResponseType>(context: FetchContext<T, R>): FetchError<T>{ ... }Type Parameters
T= unknownRextends ResponseType= ResponseTypeParameters
| Parameter | Type | Description |
|---|---|---|
context | FetchContext<T, R> | The context at the point of failure |
Returns
FetchError<T>A populated FetchError instance| Property | Type | Description |
|---|---|---|
request | FetchRequest | undefined | — |
options | FetchErrorOptions | undefined | — |
response | FetchResponse<T> | undefined | — |
data | T | undefined | — |
status | number | undefined | — |
statusText | string | undefined | — |
statusCode | number | undefined | — |
statusMessage | string | undefined | — |