From 2edc11469f0cd1df0dc7ceae2d3db3beaab58586 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Thu, 4 Jul 2024 17:35:17 +0100 Subject: [PATCH] fix(backend): minor fixes to HTTPException on endpoints --- src/backend/app/projects/project_crud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index d333f23dde..b5f577f6ef 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -229,7 +229,7 @@ async def delete_one_project(db: Session, db_project: db_models.DbProject) -> No log.info(f"Deleted project with ID: {project_id}") except Exception as e: log.exception(e) - raise HTTPException(e) from e + raise HTTPException(status_code=HTTPStatus.CONFLICT, detail=e) from e async def partial_update_project_info( @@ -395,7 +395,7 @@ async def create_tasks_from_geojson( return True except Exception as e: log.exception(e) - raise HTTPException(e) from e + raise HTTPException(HTTPStatus.UNPROCESSABLE_ENTITY, detail=e) from e async def preview_split_by_square(boundary: str, meters: int):