Spaces:
Runtime error
Runtime error
Download src/app/core/exceptions.py from kamau1/swiftops-backend: direct link, hf CLI and curl.
- Browser
- Download file 875 Bytes
-
https://huggingface.co/spaces/kamau1/swiftops-backend/resolve/main/src/app/core/exceptions.py
- Command line
-
hf download hf://spaces/kamau1/swiftops-backend/src/app/core/exceptions.py
-
curl -L -o exceptions.py https://huggingface.co/spaces/kamau1/swiftops-backend/resolve/main/src/app/core/exceptions.py
875 Bytes
| """ | |
| Custom Exception Classes | |
| """ | |
| class AppException(Exception): | |
| """Base application exception""" | |
| def __init__(self, message: str, code: str = None): | |
| self.message = message | |
| self.code = code | |
| super().__init__(self.message) | |
| class NotFoundException(AppException): | |
| """Resource not found""" | |
| pass | |
| class BusinessRuleException(AppException): | |
| """Business rule violation""" | |
| pass | |
| class ValidationException(AppException): | |
| """Data validation error""" | |
| pass | |
| class AuthenticationException(AppException): | |
| """Authentication failure""" | |
| pass | |
| class AuthorizationException(AppException): | |
| """Authorization failure""" | |
| pass | |
| class ConcurrentUpdateError(AppException): | |
| """Optimistic locking conflict""" | |
| pass | |
| class ExternalServiceException(AppException): | |
| """External service integration error""" | |
| pass | |