Exceptions¶
The HTTP exceptions crudauth raises. All subclass CustomException, which is a FastAPI
HTTPException, so they propagate with the right status code and headers.
crudauth.exceptions.CustomException
¶
CustomException(
status_code: int = HTTP_500_INTERNAL_SERVER_ERROR,
detail: str | None = None,
headers: dict[str, str] | None = None,
)
Bases: HTTPException
crudauth.exceptions.BadRequestException
¶
Bases: CustomException
crudauth.exceptions.NotFoundException
¶
Bases: CustomException
crudauth.exceptions.ForbiddenException
¶
Bases: CustomException
crudauth.exceptions.UnauthorizedException
¶
Bases: CustomException
crudauth.exceptions.UnprocessableEntityException
¶
Bases: CustomException
crudauth.exceptions.DuplicateValueException
¶
Bases: CustomException
crudauth.exceptions.RateLimitException
¶
RateLimitException(
detail: str | None = None,
retry_after: int | None = None,
headers: dict[str, str] | None = None,
)
Bases: CustomException
crudauth.exceptions.SudoLockoutError
¶
Bases: CustomException
Raised when too many wrong-password sudo attempts lock re-authentication.
Distinct from RateLimitException
(its own sudo:* counter, separate from login lockout) but shares the
429 + Retry-After shape.