Download Brain/src/common/brain_exception.py from ttt246/brain: direct link, hf CLI and curl.
- Browser
- Download file 592 Bytes
-
https://huggingface.co/spaces/ttt246/brain/resolve/main/Brain/src/common/brain_exception.py
- Command line
-
hf download hf://spaces/ttt246/brain/Brain/src/common/brain_exception.py
-
curl -L -o brain_exception.py https://huggingface.co/spaces/ttt246/brain/resolve/main/Brain/src/common/brain_exception.py
592 Bytes
| """Basic Exception in Brain""" | |
| from typing import Any | |
| from Brain.src.common.http_response_codes import responses | |
| class BrainException(Exception): | |
| JSON_PARSING_ISSUE_MSG = "Exception occurred in json paring." | |
| def __init__(self, message: str = "Exception occurred in brain", code: int = 506): | |
| self.message = message | |
| self.code = code | |
| super().__init__(self.message) | |
| def get_response_exp(self) -> Any: | |
| responses[self.code] = ("Brain Exception", self.message) | |
| return {"message": responses[self.code], "result": "", "status_code": self.code} | |