2023-05-15 08:51:32 +08:00
|
|
|
from werkzeug.exceptions import HTTPException
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BaseHTTPException(HTTPException):
|
2024-08-15 17:53:12 +08:00
|
|
|
error_code: str = "unknown"
|
2025-09-15 13:06:33 +08:00
|
|
|
data: dict | None = None
|
2023-05-15 08:51:32 +08:00
|
|
|
|
|
|
|
|
def __init__(self, description=None, response=None):
|
|
|
|
|
super().__init__(description, response)
|
|
|
|
|
|
|
|
|
|
self.data = {
|
|
|
|
|
"code": self.error_code,
|
|
|
|
|
"message": self.description,
|
|
|
|
|
"status": self.code,
|
2024-08-15 17:53:12 +08:00
|
|
|
}
|