Skip to main content

Class: QueryError

@sapphire/fetch.QueryError

The QueryError class which is thrown by the fetch method

Hierarchy

Constructors

constructor

โ€ข new QueryError(url, code, response, body)

Parameters

NameType
urlstring
codenumber
responseResponse
bodystring

Overrides

Error.constructor

Defined in

projects/utilities/packages/fetch/src/lib/QueryError.ts:19

Properties

#json

โ€ข Private #json: unknown

Defined in

projects/utilities/packages/fetch/src/lib/QueryError.ts:17


body

โ€ข Readonly body: string

The returned response body as a string

Defined in

projects/utilities/packages/fetch/src/lib/QueryError.ts:13


code

โ€ข Readonly code: number

The HTTP status code.

Defined in

projects/utilities/packages/fetch/src/lib/QueryError.ts:11


message

โ€ข message: string

Inherited from

Error.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1023


name

โ€ข name: string

Inherited from

Error.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1022


response

โ€ข Readonly response: Response

The original {@link Response} object

Defined in

projects/utilities/packages/fetch/src/lib/QueryError.ts:15


stack

โ€ข Optional stack: string

Inherited from

Error.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1024


url

โ€ข Readonly url: string

The requested url.

Defined in

projects/utilities/packages/fetch/src/lib/QueryError.ts:9


prepareStackTrace

โ–ช Static Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

Type declaration

โ–ธ (err, stackTraces): any

Optional override for formatting stack traces

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

Parameters
NameType
errError
stackTracesCallSite[]
Returns

any

Inherited from

Error.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:11


stackTraceLimit

โ–ช Static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:13

Methods

toJSON

โ–ธ toJSON(): any

Returns

any

Defined in

projects/utilities/packages/fetch/src/lib/QueryError.ts:28


captureStackTrace

โ–ธ Static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

NameType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:4