mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-30 22:05:28 +00:00
Add more error classes to docs
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
Error Handling
|
||||
==============
|
||||
|
||||
Errors are inevitable when working with the API, and they must be correctly handled by
|
||||
the use of ``try..except`` blocks.
|
||||
Errors are inevitable when working with the API, and they must be correctly handled with ``try..except`` blocks.
|
||||
|
||||
There are many errors that Telegram could return, but they all fall in one of these five exception categories
|
||||
There are many errors that Telegram could return, but they all fall in one of these categories
|
||||
(which are in turn children of the :obj:`pyrogram.Error` superclass)
|
||||
|
||||
- :obj:`303 See Other <pyrogram.api.errors.SeeOther>`
|
||||
- :obj:`400 Bad Request <pyrogram.api.errors.BadRequest>`
|
||||
- :obj:`401 Unauthorized <pyrogram.api.errors.Unauthorized>`
|
||||
- :obj:`403 Forbidden <pyrogram.api.errors.Forbidden>`
|
||||
- :obj:`406 Not Acceptable <pyrogram.api.errors.NotAcceptable>`
|
||||
- :obj:`420 Flood <pyrogram.api.errors.Flood>`
|
||||
- :obj:`500 Internal Server Error <pyrogram.api.errors.InternalServerError>`
|
||||
|
||||
@@ -56,5 +57,3 @@ before you can try again. The value is always stored in the ``x`` field of the r
|
||||
...
|
||||
except FloodWait as e:
|
||||
time.sleep(e.x)
|
||||
|
||||
**TODO: Better explanation on how to deal with exceptions**
|
Reference in New Issue
Block a user