Files
Aether/backend/app/exceptions.py
T
2026-01-05 23:31:36 +03:00

17 lines
550 B
Python

from fastapi import HTTPException, status
class InvalidTokenException(HTTPException):
def __init__(self):
super().__init__(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid token")
class TokenExpiredException(HTTPException):
def __init__(self):
super().__init__(status_code=status.HTTP_401_UNAUTHORIZED, detail="Token has expired")
class InvalidCredentialsException(HTTPException):
def __init__(self):
super().__init__(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid username or password")