refactor: 命令基本完成

This commit is contained in:
RockChinQ
2024-01-28 18:21:43 +08:00
parent 2a0cf57303
commit 1368ee22b2
21 changed files with 859 additions and 34 deletions

View File

@@ -1,12 +1,33 @@
class CommandError(Exception):
pass
def __init__(self, message: str = None):
self.message = message
def __str__(self):
return self.message
class CommandNotFoundError(CommandError):
pass
def __init__(self, message: str = None):
super().__init__("未知命令: "+message)
class CommandPrivilegeError(CommandError):
pass
def __init__(self, message: str = None):
super().__init__("权限不足: "+message)
class ParamNotEnoughError(CommandError):
def __init__(self, message: str = None):
super().__init__("参数不足: "+message)
class CommandOperationError(CommandError):
def __init__(self, message: str = None):
super().__init__("操作失败: "+message)