self-trained2 / core /exceptions.py
DeepImagix's picture
Upload 3 files
7004a3e verified
Raw
History Blame Contribute Delete
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")