Class HTTPResponseError

Represents an HTTP response error received from Telegram API. Extends the base TelegramError class to include specific details about the error response.

Hierarchy

  • Error
    • HTTPResponseError

Constructors

  • Parameters

    • response: IRequestFailt

      The response data received from the Telegram API.

    • Optionalrequest: Response

      The original HTTP response object.

    Returns HTTPResponseError

Properties

code: string | number
description: string
message: string
name: string
parameters: undefined | {
    migrate_to_chat_id?: number;
    retry_after?: number;
}
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Accessors

  • get headers(): null | Headers
  • The headers of the HTTP response.

    Returns null | Headers

    The response headers, or null if not available.

  • get status(): null | number
  • The HTTP status code of the response.

    Returns null | number

    The HTTP status code, or null if not available.

  • get statusText(): null | string
  • The status text of the HTTP response.

    Returns null | string

    The status text, or null if not available.

  • get url(): null | string
  • The URL of the request that caused the error.

    Returns null | string

    The URL of the request, or null if not available.

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void