GrammyError
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.
Extends
ts
Error
Implements
ts
ApiError
Constructors
ts
GrammyError(
message: string,
err: ApiError,
method: string,
payload: Record<string, unknown>,
);
Properties
ok
ts
readonly ok: false;
Flag that this request was unsuccessful. Always false
.
error_code
ts
readonly error_code: number;
An integer holding Telegram’s error code. Subject to change.
description
ts
readonly description: string;
A human-readable description of the error.
parameters
ts
readonly parameters: ResponseParameters;
Further parameters that may help to automatically handle the error.
method
ts
readonly method: string;
payload
ts
readonly payload: Record<string, unknown>;