From 74fc74564b9ba9935c699e430a1f3283658f42b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20S=C3=A1nchez?= Date: Sat, 6 Dec 2025 13:51:03 +0100 Subject: [PATCH] add new endpoint_ctx --- fastapi/exceptions.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py index ac5b0e0a7..33f3cf9c0 100644 --- a/fastapi/exceptions.py +++ b/fastapi/exceptions.py @@ -200,8 +200,14 @@ class ValidationException(Exception): class RequestMalformedError(ValidationException): - def __init__(self, errors: Sequence[Any], *, body: Any = None) -> None: - super().__init__(errors) + def __init__( + self, + errors: Sequence[Any], + *, + body: Any = None, + endpoint_ctx: Optional[EndpointContext] = None, + ) -> None: + super().__init__(errors, endpoint_ctx=endpoint_ctx) self.body = body