🏗️ change exception structure

This commit is contained in:
yanyongyu
2020-12-03 15:07:03 +08:00
parent 8f89e0f26e
commit 9658e446e5
6 changed files with 59 additions and 45 deletions

View File

@ -1,4 +1,4 @@
from nonebot.exception import AdapterException
from nonebot.exception import AdapterException, ActionFailed, ApiNotAvailable
class DingAdapterException(AdapterException):
@ -10,10 +10,10 @@ class DingAdapterException(AdapterException):
"""
def __init__(self) -> None:
super().__init__("DING")
super().__init__("ding")
class ApiError(DingAdapterException):
class ApiError(DingAdapterException, ActionFailed):
"""
:说明:
@ -30,7 +30,7 @@ class ApiError(DingAdapterException):
return f"<ApiError errcode={self.errcode} errmsg={self.errmsg}>"
class SessionExpired(DingAdapterException):
class SessionExpired(DingAdapterException, ApiNotAvailable):
"""
:说明:
@ -39,4 +39,4 @@ class SessionExpired(DingAdapterException):
"""
def __repr__(self) -> str:
return f"<sessionWebhook is Expired>"
return f"<Session Webhook is Expired>"