Files
big-qmt/py-client/sdk/errors.py
2026-08-28 18:52:27 +08:00

15 lines
419 B
Python

class APIError(RuntimeError):
def __init__(self, status_code: int, message: str = "") -> None:
self.status_code = status_code
self.message = message
text = f"qmt api: http {status_code}"
super().__init__(f"{text}: {message}" if message else text)
@property
def unauthorized(self) -> bool:
return self.status_code == 401
class BusinessError(RuntimeError):
pass