Class TelegramError

Represents a generic error from the Telegram API. This error class extends the standard Error object and includes additional properties for error code and description.

Hierarchy

  • Error
    • TelegramError

Constructors

  • Creates an instance of TelegramError.

    Parameters

    • code: ErrorCodes

      The error code from the enum ErrorCodes.

    • Optionalparams: Record<string, any>

      An object containing values to replace placeholders in the error message.

    Returns TelegramError

Properties

description: string
message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Returns a string representation of the error.

    Returns string

    The error code and message.

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void