Initial commit
This commit is contained in:
commit
db896255d6
744 changed files with 56028 additions and 0 deletions
17
api/libs/exception.py
Normal file
17
api/libs/exception.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from typing import Optional
|
||||
|
||||
from werkzeug.exceptions import HTTPException
|
||||
|
||||
|
||||
class BaseHTTPException(HTTPException):
|
||||
error_code: str = 'unknown'
|
||||
data: Optional[dict] = None
|
||||
|
||||
def __init__(self, description=None, response=None):
|
||||
super().__init__(description, response)
|
||||
|
||||
self.data = {
|
||||
"code": self.error_code,
|
||||
"message": self.description,
|
||||
"status": self.code,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue