Skip to content

Commit b5c6db6

Browse files
committed
Refactor project and move errors namespace out from pyrogram.api
1 parent 066633c commit b5c6db6

File tree

104 files changed

+223
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+223
-243
lines changed

compiler/api/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def start():
335335
docstring_args = "Attributes:\n ID: ``{}``\n\n ".format(c.id) + docstring_args
336336

337337
if c.section == "functions":
338-
docstring_args += "\n\n Raises:\n :obj:`Error <pyrogram.Error>`"
338+
docstring_args += "\n\n Raises:\n :obj:`RPCError <pyrogram.RPCError>`"
339339
docstring_args += "\n\n Returns:\n " + get_docstring_arg_type(c.return_type)
340340
else:
341341
references = get_references(".".join(filter(None, [c.namespace, c.name])))

compiler/error/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import shutil
2323

2424
HOME = "compiler/error"
25-
DEST = "pyrogram/api/errors/exceptions"
25+
DEST = "pyrogram/errors/exceptions"
2626
NOTICE_PATH = "NOTICE"
2727

2828

@@ -134,7 +134,7 @@ def start():
134134

135135
if "__main__" == __name__:
136136
HOME = "."
137-
DEST = "../../pyrogram/api/errors/exceptions"
137+
DEST = "../../pyrogram/errors/exceptions"
138138
NOTICE_PATH = "../../NOTICE"
139139

140140
start()

compiler/error/template/class.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{notice}
22

3-
from ..error import Error
3+
from ..rpc_error import RPCError
44

55

6-
class {super_class}(Error):
6+
class {super_class}(RPCError):
77
{docstring}
88
CODE = {code}
9-
"""``int``: Error Code"""
9+
"""``int``: RPC Error Code"""
1010
NAME = __doc__
1111

1212

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class {sub_class}({super_class}):
22
{docstring}
33
ID = {id}
4-
"""``str``: Error ID"""
4+
"""``str``: RPC Error ID"""
55
MESSAGE = __doc__
66

77

docs/source/errors/BadRequest.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
400 - Bad Request
22
=================
33

4-
.. module:: pyrogram.api.errors.BadRequest
4+
.. module:: pyrogram.errors.BadRequest
55

6-
.. automodule:: pyrogram.api.errors.exceptions.bad_request_400
6+
.. automodule:: pyrogram.errors.exceptions.bad_request_400
77
:members:
8-
:show-inheritance:

docs/source/errors/Flood.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
420 - Flood
22
===========
33

4-
.. module:: pyrogram.api.errors.Flood
4+
.. module:: pyrogram.errors.Flood
55

6-
.. automodule:: pyrogram.api.errors.exceptions.flood_420
6+
.. automodule:: pyrogram.errors.exceptions.flood_420
77
:members:
8-
:show-inheritance:

docs/source/errors/Forbidden.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
403 - Forbidden
22
===============
33

4-
.. module:: pyrogram.api.errors.Forbidden
4+
.. module:: pyrogram.errors.Forbidden
55

6-
.. automodule:: pyrogram.api.errors.exceptions.forbidden_403
6+
.. automodule:: pyrogram.errors.exceptions.forbidden_403
77
:members:
8-
:show-inheritance:
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
500 - Internal Server Error
22
===========================
33

4-
.. module:: pyrogram.api.errors.InternalServerError
4+
.. module:: pyrogram.errors.InternalServerError
55

6-
.. automodule:: pyrogram.api.errors.exceptions.internal_server_error_500
6+
.. automodule:: pyrogram.errors.exceptions.internal_server_error_500
77
:members:
8-
:show-inheritance:
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
406 - Not Acceptable
22
====================
33

4-
.. module:: pyrogram.api.errors.NotAcceptable
4+
.. module:: pyrogram.errors.NotAcceptable
55

6-
.. automodule:: pyrogram.api.errors.exceptions.not_acceptable_406
6+
.. automodule:: pyrogram.errors.exceptions.not_acceptable_406
77
:members:
8-
:show-inheritance:

docs/source/errors/SeeOther.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
303 - See Other
22
===============
33

4-
.. module:: pyrogram.api.errors.SeeOther
4+
.. module:: pyrogram.errors.SeeOther
55

6-
.. automodule:: pyrogram.api.errors.exceptions.see_other_303
6+
.. automodule:: pyrogram.errors.exceptions.see_other_303
77
:members:
8-
:show-inheritance:

0 commit comments

Comments
 (0)