55 lines
2.2 KiB
Python
55 lines
2.2 KiB
Python
"""
|
|
Registration-related exceptions for the atomic registration architecture
|
|
"""
|
|
|
|
class RegistrationException(Exception):
|
|
"""Base class for registration-related exceptions"""
|
|
pass
|
|
|
|
class RegistrationPaymentFailed(RegistrationException):
|
|
"""Exception raised when registration payment fails"""
|
|
def __init__(self, message: str = "Registration payment failed"):
|
|
super().__init__(message)
|
|
|
|
class RegistrationValidationFailed(RegistrationException):
|
|
"""Exception raised when registration validation fails"""
|
|
def __init__(self, message: str = "Registration validation failed", errors: dict = None):
|
|
self.errors = errors or {}
|
|
super().__init__(message)
|
|
|
|
class UserCreationFailed(RegistrationException):
|
|
"""Exception raised when user creation fails"""
|
|
def __init__(self, message: str = "User creation failed"):
|
|
super().__init__(message)
|
|
|
|
class TenantCreationFailed(RegistrationException):
|
|
"""Exception raised when tenant creation fails"""
|
|
def __init__(self, message: str = "Tenant creation failed"):
|
|
super().__init__(message)
|
|
|
|
class RegistrationFlowInterrupted(RegistrationException):
|
|
"""Exception raised when registration flow is interrupted"""
|
|
def __init__(self, message: str = "Registration flow interrupted"):
|
|
super().__init__(message)
|
|
|
|
class EmailAlreadyRegistered(RegistrationException):
|
|
"""Exception raised when email is already registered"""
|
|
def __init__(self, message: str = "Email already registered"):
|
|
super().__init__(message)
|
|
|
|
class RegistrationStateInvalid(RegistrationException):
|
|
"""Exception raised when registration state is invalid"""
|
|
def __init__(self, message: str = "Registration state is invalid"):
|
|
super().__init__(message)
|
|
|
|
|
|
class RegistrationStateError(RegistrationException):
|
|
"""Exception raised when registration state operations fail"""
|
|
def __init__(self, message: str = "Registration state error"):
|
|
super().__init__(message)
|
|
|
|
|
|
class InvalidStateTransitionError(RegistrationException):
|
|
"""Exception raised when an invalid state transition is attempted"""
|
|
def __init__(self, message: str = "Invalid state transition"):
|
|
super().__init__(message) |