From b07f915f6df289abdbdaed200a3a2c128c288204 Mon Sep 17 00:00:00 2001 From: HamadaSalhab Date: Fri, 15 Nov 2024 16:08:55 +0300 Subject: [PATCH] fix(agents-api): Convert assertion errors to 422 http errors --- .../agents_api/models/execution/prepare_execution_input.py | 1 + 1 file changed, 1 insertion(+) diff --git a/agents-api/agents_api/models/execution/prepare_execution_input.py b/agents-api/agents_api/models/execution/prepare_execution_input.py index 513c44a16..80382d38d 100644 --- a/agents-api/agents_api/models/execution/prepare_execution_input.py +++ b/agents-api/agents_api/models/execution/prepare_execution_input.py @@ -31,6 +31,7 @@ QueryException: partialclass(HTTPException, status_code=400), ValidationError: partialclass(HTTPException, status_code=400), TypeError: partialclass(HTTPException, status_code=400), + AssertionError: lambda e: HTTPException(status_code=422, detail=str(e)), } ) @wrap_in_class(