Put exceptions in a dedicated module to avoid circular imports

This commit is contained in:
François Voron
2022-05-06 13:17:22 +02:00
parent 5f57c75813
commit 78be936297
15 changed files with 118 additions and 141 deletions

View File

@ -0,0 +1,38 @@
from typing import Any
class FastAPIUsersException(Exception):
pass
class InvalidID(FastAPIUsersException):
pass
class UserAlreadyExists(FastAPIUsersException):
pass
class UserNotExists(FastAPIUsersException):
pass
class UserInactive(FastAPIUsersException):
pass
class UserAlreadyVerified(FastAPIUsersException):
pass
class InvalidVerifyToken(FastAPIUsersException):
pass
class InvalidResetPasswordToken(FastAPIUsersException):
pass
class InvalidPasswordException(FastAPIUsersException):
def __init__(self, reason: Any) -> None:
self.reason = reason