Class DiscordRESTError

A REST error received from Discord.

Hierarchy

  • Error
    • DiscordRESTError

Constructors

  • Parameters

    • res: Response
    • resBody: Record<string, unknown>
    • method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
    • Optional stack: string

    Returns DiscordRESTError

Properties

cause?: unknown
code: number
message: string
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
name: string
resBody: null | Record<string, unknown>
response: Response
stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Type declaration

stackTraceLimit: number

Accessors

  • get headers(): Headers
  • Returns Headers

  • get path(): string
  • Returns string

  • get status(): number
  • Returns number

  • get statusText(): string
  • Returns string

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

  • Parameters

    • errors: Record<string, unknown>
    • Optional keyPrefix: string

    Returns string[]

Generated using TypeDoc