Spaces:
Running
Running
Download core/exceptions.py from DeepImagix/self-trained2: direct link, hf CLI and curl.
- Browser
- Download file 801 Bytes
-
https://huggingface.co/spaces/DeepImagix/self-trained2/resolve/main/core/exceptions.py
- Command line
-
hf download hf://spaces/DeepImagix/self-trained2/core/exceptions.py
-
curl -L -o exceptions.py https://huggingface.co/spaces/DeepImagix/self-trained2/resolve/main/core/exceptions.py
801 Bytes
| """ | |
| Custom Exceptions for NeuraPrompt | |
| """ | |
| class NeuraPromptException(Exception): | |
| """Base exception for all NeuraPrompt errors""" | |
| def __init__(self, message: str, code: str = "INTERNAL_ERROR"): | |
| self.message = message | |
| self.code = code | |
| super().__init__(self.message) | |
| class RateLimitException(NeuraPromptException): | |
| def __init__(self, message: str = "Rate limit exceeded"): | |
| super().__init__(message, "RATE_LIMIT") | |
| class ModelNotFoundException(NeuraPromptException): | |
| def __init__(self, model_id: str): | |
| super().__init__(f"Model '{model_id}' not found", "MODEL_NOT_FOUND") | |
| class PolarVerificationException(NeuraPromptException): | |
| def __init__(self, message: str = "Polar verification failed"): | |
| super().__init__(message, "POLAR_ERROR") |