mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-31 06:16:06 +00:00
Refactor project and move errors namespace out from pyrogram.api
This commit is contained in:
@@ -335,7 +335,7 @@ def start():
|
||||
docstring_args = "Attributes:\n ID: ``{}``\n\n ".format(c.id) + docstring_args
|
||||
|
||||
if c.section == "functions":
|
||||
docstring_args += "\n\n Raises:\n :obj:`Error <pyrogram.Error>`"
|
||||
docstring_args += "\n\n Raises:\n :obj:`RPCError <pyrogram.RPCError>`"
|
||||
docstring_args += "\n\n Returns:\n " + get_docstring_arg_type(c.return_type)
|
||||
else:
|
||||
references = get_references(".".join(filter(None, [c.namespace, c.name])))
|
||||
|
@@ -22,7 +22,7 @@ import re
|
||||
import shutil
|
||||
|
||||
HOME = "compiler/error"
|
||||
DEST = "pyrogram/api/errors/exceptions"
|
||||
DEST = "pyrogram/errors/exceptions"
|
||||
NOTICE_PATH = "NOTICE"
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ def start():
|
||||
|
||||
if "__main__" == __name__:
|
||||
HOME = "."
|
||||
DEST = "../../pyrogram/api/errors/exceptions"
|
||||
DEST = "../../pyrogram/errors/exceptions"
|
||||
NOTICE_PATH = "../../NOTICE"
|
||||
|
||||
start()
|
||||
|
@@ -1,12 +1,12 @@
|
||||
{notice}
|
||||
|
||||
from ..error import Error
|
||||
from ..rpc_error import RPCError
|
||||
|
||||
|
||||
class {super_class}(Error):
|
||||
class {super_class}(RPCError):
|
||||
{docstring}
|
||||
CODE = {code}
|
||||
"""``int``: Error Code"""
|
||||
"""``int``: RPC Error Code"""
|
||||
NAME = __doc__
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
class {sub_class}({super_class}):
|
||||
{docstring}
|
||||
ID = {id}
|
||||
"""``str``: Error ID"""
|
||||
"""``str``: RPC Error ID"""
|
||||
MESSAGE = __doc__
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user