Skip to content

Commit b4da453

Browse files
committed
Documentation fixes
1 parent ef5dd96 commit b4da453

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

docs/source/resources/ErrorHandling.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ Error Handling
44
Errors are inevitable when working with the API, and they must be correctly handled with ``try..except`` blocks.
55

66
There are many errors that Telegram could return, but they all fall in one of these categories
7-
(which are in turn children of the :obj:`pyrogram.Error` superclass)
7+
(which are in turn children of the :obj:`RPCError <pyrogram.RPCError>` superclass)
88

9-
- :obj:`303 - See Other <pyrogram.api.errors.SeeOther>`
10-
- :obj:`400 - Bad Request <pyrogram.api.errors.BadRequest>`
11-
- :obj:`401 - Unauthorized <pyrogram.api.errors.Unauthorized>`
12-
- :obj:`403 - Forbidden <pyrogram.api.errors.Forbidden>`
13-
- :obj:`406 - Not Acceptable <pyrogram.api.errors.NotAcceptable>`
14-
- :obj:`420 - Flood <pyrogram.api.errors.Flood>`
15-
- :obj:`500 - Internal Server Error <pyrogram.api.errors.InternalServerError>`
9+
- :obj:`303 - See Other <pyrogram.errors.SeeOther>`
10+
- :obj:`400 - Bad Request <pyrogram.errors.BadRequest>`
11+
- :obj:`401 - Unauthorized <pyrogram.errors.Unauthorized>`
12+
- :obj:`403 - Forbidden <pyrogram.errors.Forbidden>`
13+
- :obj:`406 - Not Acceptable <pyrogram.errors.NotAcceptable>`
14+
- :obj:`420 - Flood <pyrogram.errors.Flood>`
15+
- :obj:`500 - Internal Server Error <pyrogram.errors.InternalServerError>`
1616

1717
As stated above, there are really many (too many) errors, and in case Pyrogram does not know anything yet about a
18-
specific one, it raises a special :obj:`520 Unknown Error <pyrogram.api.errors.UnknownError>` exception and logs it
18+
specific one, it raises a special :obj:`520 Unknown Error <pyrogram.errors.UnknownError>` exception and logs it
1919
in the ``unknown_errors.txt`` file. Users are invited to report these unknown errors; in later versions of Pyrogram
2020
some kind of automatic error reporting module might be implemented.
2121

@@ -24,7 +24,7 @@ Examples
2424

2525
.. code-block:: python
2626
27-
from pyrogram.api.errors import (
27+
from pyrogram.errors import (
2828
BadRequest, Flood, InternalServerError,
2929
SeeOther, Unauthorized, UnknownError
3030
)
@@ -45,13 +45,13 @@ Examples
4545
pass
4646
4747
Exception objects may also contain some informative values.
48-
E.g.: :obj:`FloodWait <pyrogram.api.errors.exceptions.flood_420.FloodWait>` holds the amount of seconds you have to wait
48+
E.g.: :obj:`FloodWait <pyrogram.errors.exceptions.flood_420.FloodWait>` holds the amount of seconds you have to wait
4949
before you can try again. The value is always stored in the ``x`` field of the returned exception object:
5050

5151
.. code-block:: python
5252
5353
import time
54-
from pyrogram.api.errors import FloodWait
54+
from pyrogram.errors import FloodWait
5555
5656
try:
5757
...

pyrogram/client/types/messages_and_media/poll_option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class PollOption(PyrogramType):
2929
3030
voters (``int``):
3131
The number of users who voted this option.
32+
It will be 0 until you vote for the poll.
3233
3334
data (``bytes``):
3435
Unique data that identifies this option among all the other options in a poll.

0 commit comments

Comments
 (0)