File size: 801 Bytes
7004a3e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
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")