websocket api

This commit is contained in:
yanyongyu
2020-08-13 15:23:04 +08:00
parent 0e73d4ce20
commit e7f9b2c229
10 changed files with 141 additions and 35 deletions

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from nonebot.typing import Optional
class IgnoredException(Exception):
"""
@ -33,3 +35,21 @@ class FinishedException(Exception):
class ApiNotAvailable(Exception):
"""Api is not available"""
pass
class NetworkError(Exception):
"""There is something error with the network"""
pass
class ActionFailed(Exception):
"""The action call returned a failed response"""
def __init__(self, retcode: Optional[int]):
self.retcode = retcode
def __repr__(self):
return f"<ActionFailed, retcode={self.retcode}>"
def __str__(self):
return self.__repr__()