minor: global exception names

This commit is contained in:
Chris Milne 2026-05-29 09:47:37 +01:00
parent 987a050b4b
commit 4a97789c1a

View file

@ -1,21 +1,25 @@
""" """
Global exceptions Global exceptions
Exports:
- UnprocessableContentException
- ConflictException
""" """
from typing import Optional from typing import Optional
from fastapi import HTTPException, status from fastapi import HTTPException, status
class UnprocessableContent(HTTPException): class UnprocessableContentException(HTTPException):
def __init__(self, message: Optional[str] = None) -> None: def __init__(self, message: Optional[str] = None) -> None:
detail = "Not authorized" if not message else message detail = "Unprocessable content" if not message else message
super().__init__( super().__init__(
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
detail=detail, detail=detail,
) )
class Conflict(HTTPException): class ConflictException(HTTPException):
def __init__(self, message: Optional[str] = None) -> None: def __init__(self, message: Optional[str] = None) -> None:
detail = "Conflict" if not message else message detail = "Conflict" if not message else message
super().__init__( super().__init__(