Spaces:
Sleeping
Sleeping
Download core/exceptions.py from Qurrah/replyflow-rag: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/spaces/Qurrah/replyflow-rag/resolve/main/core/exceptions.py
- Command line
-
hf download hf://spaces/Qurrah/replyflow-rag/core/exceptions.py
-
curl -L -o exceptions.py https://huggingface.co/spaces/Qurrah/replyflow-rag/resolve/main/core/exceptions.py
1.43 kB
| class BaseAppException(Exception): | |
| """Base exception for all application-specific errors.""" | |
| def __init__(self, message: str, status_code: int = 400): | |
| self.message = message | |
| self.status_code = status_code | |
| super().__init__(self.message) | |
| class WorkspaceNotFoundError(BaseAppException): | |
| """Raised when a workspace or brand is not found.""" | |
| def __init__(self, message: str = "Workspace not found"): | |
| super().__init__(message, status_code=404) | |
| class DocumentNotFoundError(BaseAppException): | |
| """Raised when a document is not found.""" | |
| def __init__(self, message: str = "Document not found"): | |
| super().__init__(message, status_code=404) | |
| class ShopifyError(BaseAppException): | |
| """Base for Shopify-related errors.""" | |
| pass | |
| class ShopifyTimeoutError(ShopifyError): | |
| def __init__(self, message: str = "Shopify request timed out"): | |
| super().__init__(message, status_code=504) | |
| class ShopifyConnectionError(ShopifyError): | |
| def __init__(self, message: str = "Could not connect to Shopify"): | |
| super().__init__(message, status_code=502) | |
| class RateLimitExceeded(BaseAppException): | |
| def __init__(self, message: str = "Rate limit exceeded"): | |
| super().__init__(message, status_code=429) | |
| class InvalidRequestError(BaseAppException): | |
| def __init__(self, message: str = "Invalid request"): | |
| super().__init__(message, status_code=400) | |