sdk/oapiSdk/lark_oapi/ws/exception.py

35 lines
805 B
Python
Raw Normal View History

2025-08-19 10:20:23 +00:00
class ClientException(Exception):
def __init__(self, code: int, msg: str):
super().__init__(msg)
self.code = code
def __str__(self):
return f"{self.code}: {super().__str__()}"
class ServerException(Exception):
def __init__(self, code: int, msg: str):
super().__init__(msg)
self.code = code
def __str__(self):
return f"{self.code}: {super().__str__()}"
class HeaderNotFoundException(Exception):
def __init__(self, key: str):
self.key = key
def __str__(self):
return f"{self.key} not found"
class ConnectionClosedException(Exception):
def __init__(self, msg: str):
super().__init__(msg)
class ServerUnreachableException(Exception):
def __init__(self, msg: str):
super().__init__(msg)