diff --git a/docs/source/api/errors.rst b/docs/source/api/errors.rst index 51d1fcd3..29dcafac 100644 --- a/docs/source/api/errors.rst +++ b/docs/source/api/errors.rst @@ -1,28 +1,73 @@ RPC Errors ========== -All the Pyrogram errors listed here live inside the ``errors`` sub-package. +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. -**Example:** +**Example**: .. code-block:: python - from pyrogram.errors import RPCError + from pyrogram.errors import InternalServerError try: ... - except RPCError: + except FloodWait: ... -.. autoexception:: pyrogram.RPCError() - :members: +303 - See Other +--------------- -.. toctree:: - ../errors/see-other - ../errors/bad-request - ../errors/unauthorized - ../errors/forbidden - ../errors/not-acceptable - ../errors/flood - ../errors/internal-server-error - ../errors/unknown-error +.. csv-table:: + :file: ../../../compiler/error/source/303_SEE_OTHER.tsv + :delim: tab + :header-rows: 1 + +400 - Bad Request +----------------- + +.. csv-table:: + :file: ../../../compiler/error/source/400_BAD_REQUEST.tsv + :delim: tab + :header-rows: 1 + +401 - Unauthorized +------------------ + +.. csv-table:: + :file: ../../../compiler/error/source/401_UNAUTHORIZED.tsv + :delim: tab + :header-rows: 1 + +403 - Forbidden +--------------- + +.. csv-table:: + :file: ../../../compiler/error/source/403_FORBIDDEN.tsv + :delim: tab + :header-rows: 1 + +406 - Not Acceptable +-------------------- + +.. csv-table:: + :file: ../../../compiler/error/source/406_NOT_ACCEPTABLE.tsv + :delim: tab + :header-rows: 1 + +420 - Flood +----------- + +.. csv-table:: + :file: ../../../compiler/error/source/420_FLOOD.tsv + :delim: tab + :header-rows: 1 + +500 - Internal Server Error +--------------------------- + +.. csv-table:: + :file: ../../../compiler/error/source/500_INTERNAL_SERVER_ERROR.tsv + :delim: tab + :header-rows: 1 diff --git a/docs/source/errors/bad-request.rst b/docs/source/errors/bad-request.rst deleted file mode 100644 index 2d56434c..00000000 --- a/docs/source/errors/bad-request.rst +++ /dev/null @@ -1,7 +0,0 @@ -400 - Bad Request -================= - -.. module:: pyrogram.errors.BadRequest - -.. automodule:: pyrogram.errors.exceptions.bad_request_400 - :members: diff --git a/docs/source/errors/flood.rst b/docs/source/errors/flood.rst deleted file mode 100644 index 55098cbb..00000000 --- a/docs/source/errors/flood.rst +++ /dev/null @@ -1,7 +0,0 @@ -420 - Flood -=========== - -.. module:: pyrogram.errors.Flood - -.. automodule:: pyrogram.errors.exceptions.flood_420 - :members: diff --git a/docs/source/errors/forbidden.rst b/docs/source/errors/forbidden.rst deleted file mode 100644 index cd794979..00000000 --- a/docs/source/errors/forbidden.rst +++ /dev/null @@ -1,7 +0,0 @@ -403 - Forbidden -=============== - -.. module:: pyrogram.errors.Forbidden - -.. automodule:: pyrogram.errors.exceptions.forbidden_403 - :members: diff --git a/docs/source/errors/internal-server-error.rst b/docs/source/errors/internal-server-error.rst deleted file mode 100644 index 7f78d519..00000000 --- a/docs/source/errors/internal-server-error.rst +++ /dev/null @@ -1,7 +0,0 @@ -500 - Internal Server Error -=========================== - -.. module:: pyrogram.errors.InternalServerError - -.. automodule:: pyrogram.errors.exceptions.internal_server_error_500 - :members: diff --git a/docs/source/errors/not-acceptable.rst b/docs/source/errors/not-acceptable.rst deleted file mode 100644 index 5a8365fc..00000000 --- a/docs/source/errors/not-acceptable.rst +++ /dev/null @@ -1,7 +0,0 @@ -406 - Not Acceptable -==================== - -.. module:: pyrogram.errors.NotAcceptable - -.. automodule:: pyrogram.errors.exceptions.not_acceptable_406 - :members: diff --git a/docs/source/errors/see-other.rst b/docs/source/errors/see-other.rst deleted file mode 100644 index f90902d0..00000000 --- a/docs/source/errors/see-other.rst +++ /dev/null @@ -1,7 +0,0 @@ -303 - See Other -=============== - -.. module:: pyrogram.errors.SeeOther - -.. automodule:: pyrogram.errors.exceptions.see_other_303 - :members: diff --git a/docs/source/errors/unauthorized.rst b/docs/source/errors/unauthorized.rst deleted file mode 100644 index d47ed3fb..00000000 --- a/docs/source/errors/unauthorized.rst +++ /dev/null @@ -1,7 +0,0 @@ -401 - Unauthorized -================== - -.. module:: pyrogram.errors.Unauthorized - -.. automodule:: pyrogram.errors.exceptions.unauthorized_401 - :members: diff --git a/docs/source/errors/unknown-error.rst b/docs/source/errors/unknown-error.rst deleted file mode 100644 index 21495957..00000000 --- a/docs/source/errors/unknown-error.rst +++ /dev/null @@ -1,7 +0,0 @@ -520 - Unknown Error -=================== - -.. module:: pyrogram.errors.UnknownError - -.. autoexception:: pyrogram.errors.rpc_error.UnknownError - :members: diff --git a/docs/source/index.rst b/docs/source/index.rst index ae6a2fda..81b4213c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -157,4 +157,4 @@ Topics :caption: Telegram API telegram/functions/index - telegram/types/index + telegram/types/index \ No newline at end of file diff --git a/docs/source/topics/faq.rst b/docs/source/topics/faq.rst index f647e261..5a8a3929 100644 --- a/docs/source/topics/faq.rst +++ b/docs/source/topics/faq.rst @@ -68,7 +68,7 @@ in a bunch of seconds: I keep getting [400 PEER_ID_INVALID] error! ------------------------------------------- -The error in question is ``[400 PEER_ID_INVALID]: The id/access_hash combination is invalid``, and could mean several +The error in question is **[400 PEER_ID_INVALID]: The id/access_hash combination is invalid**, and could mean several things: - The chat id you tried to use is simply wrong, double check it.