mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-08-15 03:04:27 +08:00
Put exceptions in a dedicated module to avoid circular imports
This commit is contained in:
38
fastapi_users/exceptions.py
Normal file
38
fastapi_users/exceptions.py
Normal 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
|
Reference in New Issue
Block a user