Files
RekomenciBackend/src/template_project/application/auth_identity/errors.py
T
2025-11-19 01:27:15 +03:00

35 lines
705 B
Python

from typing import override
from template_project.application.auth_identity.entity import AuthMethod
from template_project.application.common.errors import ApplicationError, to_error
@to_error
class UserAlreadyExistsError(ApplicationError):
identifier: str
auth_method: AuthMethod
@override
def __str__(self) -> str:
return f"User with identifier={self.identifier!r} and auth method={self.auth_method.value} already exists"
@to_error
class AuthError(ApplicationError):
pass
@to_error
class InvalidCodeError(ApplicationError):
pass
@to_error
class InvalidCredentialsError(ApplicationError):
pass
@to_error
class UserNotFoundError(ApplicationError):
pass