Download api/libs/exception.py from Underground-Digital/Workflow-Engine: direct link, hf CLI and curl.
- Browser
- Download file 431 Bytes
-
https://huggingface.co/spaces/Underground-Digital/Workflow-Engine/resolve/main/api/libs/exception.py
- Command line
-
hf download hf://spaces/Underground-Digital/Workflow-Engine/api/libs/exception.py
-
curl -L -o exception.py https://huggingface.co/spaces/Underground-Digital/Workflow-Engine/resolve/main/api/libs/exception.py
431 Bytes
| 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, | |
| } | |