Spaces:
Running
Running
| """ | |
| 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") |