From 368a03dc70f55ddc8737919d993cc76b4e9f6a94 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sat, 6 Jan 2024 17:55:49 +0200 Subject: [PATCH] Fix internal ValueError exception should return 422 (not 404 as before) --- clearml_serving/serving/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clearml_serving/serving/main.py b/clearml_serving/serving/main.py index e6847f5..845accf 100644 --- a/clearml_serving/serving/main.py +++ b/clearml_serving/serving/main.py @@ -89,7 +89,7 @@ async def serve_model(model_id: str, version: Optional[str] = None, request: Uni request_body=request ) except ValueError as ex: - raise HTTPException(status_code=404, detail="Error processing request: {}".format(ex)) + raise HTTPException(status_code=422, detail="Error processing request: {}".format(ex)) except Exception as ex: raise HTTPException(status_code=500, detail="Error processing request: {}".format(ex)) return return_value