Download src/backend/base/langflow/services/store/exceptions.py from opendigital/agent-flow: direct link, hf CLI and curl.
- Browser
- Download file 739 Bytes
-
https://huggingface.co/opendigital/agent-flow/resolve/main/src/backend/base/langflow/services/store/exceptions.py
- Command line
-
hf download hf://opendigital/agent-flow/src/backend/base/langflow/services/store/exceptions.py
-
curl -L -o exceptions.py https://huggingface.co/opendigital/agent-flow/resolve/main/src/backend/base/langflow/services/store/exceptions.py
739 Bytes
| class CustomError(Exception): | |
| def __init__(self, detail: str, status_code: int): | |
| super().__init__(detail) | |
| self.status_code = status_code | |
| # Define custom exceptions with status codes | |
| class UnauthorizedError(CustomError): | |
| def __init__(self, detail: str = "Unauthorized access"): | |
| super().__init__(detail, 401) | |
| class ForbiddenError(CustomError): | |
| def __init__(self, detail: str = "Forbidden"): | |
| super().__init__(detail, 403) | |
| class APIKeyError(CustomError): | |
| def __init__(self, detail: str = "API key error"): | |
| super().__init__(detail, 400) # ! Should be 401 | |
| class FilterError(CustomError): | |
| def __init__(self, detail: str = "Filter error"): | |
| super().__init__(detail, 400) | |