dify
This commit is contained in:
15
dify/api/libs/exception.py
Normal file
15
dify/api/libs/exception.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from werkzeug.exceptions import HTTPException
|
||||
|
||||
|
||||
class BaseHTTPException(HTTPException):
|
||||
error_code: str = "unknown"
|
||||
data: dict | None = None
|
||||
|
||||
def __init__(self, description=None, response=None):
|
||||
super().__init__(description, response)
|
||||
|
||||
self.data = {
|
||||
"code": self.error_code,
|
||||
"message": self.description,
|
||||
"status": self.code,
|
||||
}
|
||||
Reference in New Issue
Block a user