From 3dbd72a109a35d6d875e8f16457f2214abaeb609 Mon Sep 17 00:00:00 2001 From: luxferre Date: Wed, 10 Jun 2026 14:47:33 +0100 Subject: [PATCH] feat: 403 exception --- src/exceptions.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/exceptions.py b/src/exceptions.py index 8b3629c..5a6ed3a 100644 --- a/src/exceptions.py +++ b/src/exceptions.py @@ -27,3 +27,12 @@ class ConflictException(HTTPException): status_code=status.HTTP_409_CONFLICT, detail=detail, ) + + +class ForbiddenException(HTTPException): + def __init__(self, message: Optional[str] = None) -> None: + detail = "Forbidden" if not message else message + super().__init__( + status_code=status.HTTP_403_FORBIDDEN, + detail=detail, + )