Overview
Gogram provides several mechanisms to handle errors that occur during update processing or API requests.Handler Errors
When a handler returns anerror, Gogram processes it based on the type of error.
Logging Errors
By default, if a handler returns an error (and it is nottelegram.EndGroup), the error is logged using the client’s logger.
Stopping Propagation
To stop the execution of subsequent handlers in the same group, returntelegram.ErrEndGroup. This is useful for “middleware-like” handlers that filter out updates.
Client Error Handlers
You can configure global error handlers when creating theClient.
Flood Wait Handler
Telegram imposes rate limits. When you hit a limit, Telegram returns aFLOOD_WAIT_X error. You can define a FloodHandler to decide whether to wait and retry.
Global RPC Error Handler
For other RPC errors (e.g., internal server errors), you can useErrorHandler.