Class DiscordAPIError

Represents an API error returned by Discord

Hierarchy

  • Error
    • DiscordAPIError

Constructors

  • Parameters

    • rawError: DiscordErrorData | OAuthErrorData

      The error reported by Discord

    • code: string | number

      The error code reported by Discord

    • status: number

      The status code of the response

    • method: string

      The method of the request that erred

    • url: string

      The url of the request that erred

    • bodyData: Pick<InternalRequest, "files" | "body">

      The unparsed data for the request that errored

    Returns DiscordAPIError

Properties

cause?: unknown
code: string | number
message: string
method: string
requestBody: RequestBody
stack?: string
status: number
url: string
flattenDiscordError: any
getMessage: any
prepareStackTrace?: ((err, stackTraces) => any)

Type declaration

stackTraceLimit: number

Accessors

  • get name(): string
  • The name of the error

    Returns string

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc