Files
orion/app/exceptions/__init__.py

121 lines
2.9 KiB
Python

# app/exceptions/__init__.py
"""
Custom exception classes for the LetzShop API.
This module provides frontend-friendly exceptions with consistent error codes,
messages, and HTTP status mappings.
"""
from .base import (
LetzShopException,
ValidationException,
AuthenticationException,
AuthorizationException,
ResourceNotFoundException,
ConflictException,
BusinessLogicException,
ExternalServiceException,
RateLimitException,
)
from .auth import (
InvalidCredentialsException,
TokenExpiredException,
InsufficientPermissionsException,
UserNotActiveException,
AdminRequiredException,
)
from .product import (
ProductNotFoundException,
ProductAlreadyExistsException,
InvalidProductDataException,
ProductValidationException,
)
from .stock import (
StockNotFoundException,
InsufficientStockException,
InvalidStockOperationException,
StockValidationException,
)
from .shop import (
ShopNotFoundException,
ShopAlreadyExistsException,
ShopNotActiveException,
ShopNotVerifiedException,
UnauthorizedShopAccessException,
InvalidShopDataException,
)
from .marketplace import (
MarketplaceImportException,
ImportJobNotFoundException,
ImportJobNotOwnedException,
InvalidImportDataException,
ImportJobCannotBeCancelledException,
ImportJobCannotBeDeletedException,
)
from .admin import (
UserNotFoundException,
UserStatusChangeException,
ShopVerificationException,
AdminOperationException,
)
__all__ = [
# Base exceptions
"LetzShopException",
"ValidationException",
"AuthenticationException",
"AuthorizationException",
"ResourceNotFoundException",
"ConflictException",
"BusinessLogicException",
"ExternalServiceException",
"RateLimitException",
# Auth exceptions
"InvalidCredentialsException",
"TokenExpiredException",
"InsufficientPermissionsException",
"UserNotActiveException",
"AdminRequiredException",
# Product exceptions
"ProductNotFoundException",
"ProductAlreadyExistsException",
"InvalidProductDataException",
"ProductValidationException",
# Stock exceptions
"StockNotFoundException",
"InsufficientStockException",
"InvalidStockOperationException",
"StockValidationException",
# Shop exceptions
"ShopNotFoundException",
"ShopAlreadyExistsException",
"ShopNotActiveException",
"ShopNotVerifiedException",
"UnauthorizedShopAccessException",
"InvalidShopDataException",
# Marketplace exceptions
"MarketplaceImportException",
"ImportJobNotFoundException",
"ImportJobNotOwnedException",
"InvalidImportDataException",
"ImportJobCannotBeCancelledException",
"ImportJobCannotBeDeletedException",
# Admin exceptions
"UserNotFoundException",
"UserStatusChangeException",
"ShopVerificationException",
"AdminOperationException",
]