mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-12 06:56:41 +00:00
✨ Add ding adapter
This commit is contained in:
29
nonebot/adapters/ding/exception.py
Normal file
29
nonebot/adapters/ding/exception.py
Normal file
@ -0,0 +1,29 @@
|
||||
from nonebot.exception import AdapterException
|
||||
|
||||
|
||||
class DingAdapterException(AdapterException):
|
||||
|
||||
def __init__(self) -> None:
|
||||
super.__init__("DING")
|
||||
|
||||
|
||||
class ApiError(DingAdapterException):
|
||||
"""
|
||||
:说明:
|
||||
|
||||
API 请求成功返回数据,但 API 操作失败。
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, errcode: int, errmsg: str):
|
||||
self.errcode = errcode
|
||||
self.errmsg = errmsg
|
||||
|
||||
def __repr__(self):
|
||||
return f"<ApiError errcode={self.errcode} errmsg={self.errmsg}>"
|
||||
|
||||
|
||||
class SessionExpired(DingAdapterException):
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"<sessionWebhook is Expired>"
|
Reference in New Issue
Block a user