Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/grammy/mod.ts>GrammyError

The Telegram Bot Framework.
Go to Latest
class GrammyError
implements ApiError
extends Error
import { GrammyError } from "https://deno.land/x/grammy@v1.15.3/mod.ts";

This class represents errors that are thrown by grammY because the Telegram Bot API responded with an error.

Instances of this class hold the information that the Telegram backend returned.

If this error is thrown, grammY could successfully communicate with the Telegram Bot API servers, however, an error code was returned for the respective method call.

Constructors

new
GrammyError(
message: string,
err: ApiError,
method: string,
payload: Record<string, unknown>,
)

Properties

readonly
description: string

A human-readable description of the error.

readonly
error_code: number

An integer holding Telegram's error code. Subject to change.

readonly
ok: false

Flag that this request was unsuccessful. Always false.

readonly
parameters: ResponseParameters

Further parameters that may help to automatically handle the error.