From 67e7dc35c34a14dfa36f9a135a8c280bf6a60a03 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Mon, 8 Jan 2024 10:18:41 +0000 Subject: [PATCH] fix: raise HTTPException if data extract fails --- src/backend/app/projects/project_crud.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index b795ec2e06..f3702df53f 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -662,7 +662,10 @@ async def get_data_extract_url( error_dict = result.json() error_dict["status_code"] = result.status_code log.error(f"Failed to get extract from raw data api: {error_dict}") - return error_dict + raise HTTPException( + status_code=error_dict.get("status_code"), + detail=error_dict.get("detail"), + ) task_id = result.json()["task_id"]