Skip to main content

ResponseError

Represents an error that occurs during an HTTP request made with Fetchtastic. It encapsulates information about the error, including the request URL, status code, response details, and error message.

Extends​

  • Error

Constructors​

new ResponseError()​

new ResponseError(response, method): ResponseError

Creates a new instance of the HttpError class.

Parameters​

ParameterTypeDescription
responseResponseThe Response object received from the failed request.
method| "OPTIONS" | "GET" | "HEAD" | "PUT" | "POST" | "DELETE" | "PATCH"The HTTP method used in the failed request.

Returns​

ResponseError

Overrides​

Error.constructor

Properties​

cause?​

optional cause: unknown;

Inherited from​

Error.cause


message​

message: string;

Inherited from​

Error.message


method​

method: 
| "OPTIONS"
| "GET"
| "HEAD"
| "PUT"
| "POST"
| "DELETE"
| "PATCH";

Indicates the HTTP method used in the failed request.


name​

name: string;

Inherited from​

Error.name


response​

response: Response;

Refers to the Response object received from the failed request.


stack?​

optional stack: string;

Inherited from​

Error.stack


prepareStackTrace()?​

static optional prepareStackTrace: (err, stackTraces) => any;

Optional override for formatting stack traces

Parameters​

ParameterType
errError
stackTracesCallSite[]

Returns​

any

See​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from​

Error.prepareStackTrace


stackTraceLimit​

static stackTraceLimit: number;

Inherited from​

Error.stackTraceLimit

Methods​

captureStackTrace()​

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters​

ParameterType
targetObjectobject
constructorOpt?Function

Returns​

void

Inherited from​

Error.captureStackTrace