Spaces:
Sleeping

File size: 763 Bytes
7c87115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Service layer errors and exceptions."""

class ServiceError(Exception):
    """Base class for all service layer errors."""
    def __init__(self, message: str, user_message: str = None, debug_code: str = None):
        super().__init__(message)
        self.user_message = user_message or message
        self.debug_code = debug_code

class ValidationError(ServiceError):
    """Raised when input parameters are invalid."""
    pass

class NotFoundError(ServiceError):
    """Raised when a resource (notebook, source, etc.) is not found."""
    pass

class CreationError(ServiceError):
    """Raised when a creation operation fails (e.g. fail-fast check)."""
    pass

class ExportError(ServiceError):
    """Raised when an export operation fails."""
    pass