Skip to content

Commit 54f3f87

Browse files
[IMP] fastapi: show message for AccessError | MissingError
1 parent e8d767d commit 54f3f87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fastapi/error_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ def convert_exception_to_status_body(exc: Exception) -> tuple[int, dict]:
3636
details = jsonable_encoder(exc.errors())
3737
elif isinstance(exc, AccessDenied | AccessError):
3838
status_code = status.HTTP_403_FORBIDDEN
39-
details = "AccessError"
39+
details = exc.args[0]
4040
elif isinstance(exc, MissingError):
4141
status_code = status.HTTP_404_NOT_FOUND
42-
details = "MissingError"
42+
details = exc.args[0]
4343
elif isinstance(exc, UserError):
4444
status_code = status.HTTP_400_BAD_REQUEST
4545
details = exc.args[0]

0 commit comments

Comments
 (0)