RPC Errors#

All Pyrogram API errors live inside the errors sub-package: pyrogram.errors. The errors ids listed here are shown as UPPER_SNAKE_CASE, but the actual exception names to import from Pyrogram follow the usual PascalCase convention.

from pyrogram.errors import FloodWait

try:
    ...
except FloodWait as e:
    ...

RPC Errors

There isn’t any official list of all possible RPC errors, so the list of known errors is provided on a best-effort basis. When new methods are available, the list may be lacking since we simply don’t know what errors can raise from them. Pyrogram creates an unknown_errors.txt file in the root directory from where the Client is run.

PLEASE DO NOT DO THIS

Tip

If you do not want this file to be created, set the PYROGRAM_DONOT_LOG_UNKNOWN_ERRORS environment variable before running the Pyrogram Client.

Tip

If you want the file to be created in a different location, set the PYROGRAM_LOG_UNKNOWN_ERRORS_FILENAME to a file path of your choice.