Exceptions¶
litestar_auth.exceptions
¶
Custom exception hierarchy for litestar-auth.
AuthenticationError(message=None, code=None)
¶
Bases: LitestarAuthError
Raised when authentication fails.
Source code in litestar_auth/exceptions.py
AuthorizationError(message=None, code=None)
¶
Bases: LitestarAuthError
Raised when an authenticated user is not allowed to perform an action.
Source code in litestar_auth/exceptions.py
ConfigurationError(message=None, code=None)
¶
Bases: LitestarAuthError
Raised when the library is configured incorrectly.
Source code in litestar_auth/exceptions.py
ErrorCode
¶
String constants for machine-readable error responses.
InactiveUserError(message=None, code=None)
¶
Bases: AuthenticationError
Raised when an operation requires an active account.
Source code in litestar_auth/exceptions.py
InvalidPasswordError(message=None, code=None)
¶
Bases: AuthenticationError
Raised when a password does not match the stored credentials.
Source code in litestar_auth/exceptions.py
InvalidResetPasswordTokenError(message=None, code=None)
¶
Bases: TokenError
Raised when a password reset token is invalid or expired.
Source code in litestar_auth/exceptions.py
InvalidVerifyTokenError(message=None, code=None)
¶
Bases: TokenError
Raised when an email verification token is invalid or expired.
Source code in litestar_auth/exceptions.py
LitestarAuthError(message=None, code=None)
¶
Bases: Exception
Base exception for all library-specific errors.
Initialize the exception with a default or custom message and optional code.
Source code in litestar_auth/exceptions.py
OAuthAccountAlreadyLinkedError(message=None, code=None)
¶
Bases: AuthenticationError
Raised when an OAuth provider identity is already linked to another user.
Persistence layer refuses cross-user rebinding: one provider identity (oauth_name, account_id) can only be linked to a single local user.
Source code in litestar_auth/exceptions.py
TokenError(message=None, code=None)
¶
Bases: LitestarAuthError
Raised when token operations fail.
Source code in litestar_auth/exceptions.py
UnverifiedUserError(message=None, code=None)
¶
Bases: AuthenticationError
Raised when an operation requires a verified account.
Source code in litestar_auth/exceptions.py
UserAlreadyExistsError(message=None, code=None)
¶
Bases: AuthenticationError
Raised when creating a user that already exists.
Source code in litestar_auth/exceptions.py
UserNotExistsError(message=None, code=None)
¶
Bases: AuthenticationError
Raised when a requested user cannot be found.