Skip to content

Commit 75551be

Browse files
committed
convert exception into 409 status error
1 parent ac4a4ef commit 75551be

File tree

1 file changed

+10
-4
lines changed
  • services/director-v2/src/simcore_service_director_v2/api/routes

1 file changed

+10
-4
lines changed

services/director-v2/src/simcore_service_director_v2/api/routes/computations.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
ComputationalRunNotFoundError,
5454
ComputationalSchedulerError,
5555
ConfigurationError,
56+
PipelineTaskMissingError,
5657
PricingPlanUnitNotFoundError,
5758
ProjectNotFoundError,
5859
WalletNotEnoughCreditsError,
@@ -453,10 +454,15 @@ async def get_computation(
453454
# check that project actually exists
454455
await project_repo.get_project(project_id)
455456

456-
pipeline_info = await validate_pipeline(
457-
project_id, comp_pipelines_repo, comp_tasks_repo
458-
)
459-
457+
try:
458+
pipeline_info = await validate_pipeline(
459+
project_id, comp_pipelines_repo, comp_tasks_repo
460+
)
461+
except PipelineTaskMissingError as exc:
462+
raise HTTPException(
463+
status_code=status.HTTP_409_CONFLICT,
464+
detail="The tasks referenced by the pipeline are missing",
465+
) from exc
460466
# create the complete DAG graph
461467
complete_dag = create_complete_dag_from_tasks(pipeline_info.all_tasks)
462468
pipeline_details = await compute_pipeline_details(

0 commit comments

Comments
 (0)