DiscordAPIError

export declare class DiscordAPIError extends Error
export declare class DiscordAPIError extends Error
Represents an API error returned by Discord

Extends

Error
constructor(rawError, code, status, method, url, bodyData)
Constructs a new instance of the DiscordAPIError class
NameTypeOptionalDescription
rawErrorDiscordErrorData | OAuthErrorDataNo
The error reported by Discord
codenumber | stringNo
The error code reported by Discord
statusnumberNo
The status code of the response
methodstringNo
The method of the request that erred
urlstringNo
The url of the request that erred
bodyDataPick<InternalRequest, 'body' | 'files'>No
The unparsed data for the request that errored
code:number | string
method:string
Readonly
name:string
The name of the error
requestBody:RequestBody
status:number
url:string