From 5302f988cf45c066904de5b7d85b6b2043247fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20S=C3=A1nchez?= Date: Mon, 24 Nov 2025 12:30:50 +0100 Subject: [PATCH] linter --- fastapi/routing.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index d7a585df1..6e04629ce 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -351,7 +351,7 @@ def get_request_handler( else: body = body_bytes except json.JSONDecodeError as e: - validation_error = RequestMalformedError( + raise RequestMalformedError( [ { "type": "json_invalid", @@ -362,8 +362,7 @@ def get_request_handler( } ], body=e.doc, - ) - raise validation_error from e + ) from e except HTTPException: # If a middleware raises an HTTPException, it should be raised again raise