mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Add more error classes to docs
This commit is contained in:
parent
e4bead530c
commit
4a01745c68
8
docs/source/errors/Forbidden.rst
Normal file
8
docs/source/errors/Forbidden.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Forbidden
|
||||
=========
|
||||
|
||||
.. module:: pyrogram.api.errors.Forbidden
|
||||
|
||||
.. automodule:: pyrogram.api.errors.exceptions.forbidden_403
|
||||
:members:
|
||||
:show-inheritance:
|
8
docs/source/errors/NotAcceptable.rst
Normal file
8
docs/source/errors/NotAcceptable.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Not Acceptable
|
||||
==============
|
||||
|
||||
.. module:: pyrogram.api.errors.NotAcceptable
|
||||
|
||||
.. automodule:: pyrogram.api.errors.exceptions.not_acceptable_406
|
||||
:members:
|
||||
:show-inheritance:
|
@ -9,6 +9,8 @@ Error
|
||||
../errors/SeeOther
|
||||
../errors/BadRequest
|
||||
../errors/Unauthorized
|
||||
../errors/Forbidden
|
||||
../errors/NotAcceptable
|
||||
../errors/Flood
|
||||
../errors/InternalServerError
|
||||
../errors/UnknownError
|
||||
|
@ -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**
|
Loading…
x
Reference in New Issue
Block a user