forked from sr2/cloud-api
feat: 403 exception
This commit is contained in:
parent
ec572aa4c1
commit
3dbd72a109
1 changed files with 9 additions and 0 deletions
|
|
@ -27,3 +27,12 @@ class ConflictException(HTTPException):
|
||||||
status_code=status.HTTP_409_CONFLICT,
|
status_code=status.HTTP_409_CONFLICT,
|
||||||
detail=detail,
|
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,
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue