diff --git a/src/api/src/backend/services/TaskService.py b/src/api/src/backend/services/TaskService.py index 7b4679af..b312a2b5 100644 --- a/src/api/src/backend/services/TaskService.py +++ b/src/api/src/backend/services/TaskService.py @@ -101,7 +101,7 @@ def create(self, pipeline, request): code=getattr(request, "code", None), command=getattr(request, "command", None), context=context, - conditions=getattr(request, "conditions", []), + conditions=getattr(request, "conditions", []).model_dump(), data=getattr(request, "data", None), description=request.description, destination=destination, @@ -151,8 +151,9 @@ def create(self, pipeline, request): except ModelValidationError as e: self.rollback() raise e - except Exception as e: - print(f"Generic Exception: {e}", request.id, flush=True) + except ServerError as e: + self.rollback() + # print(f"Generic Exception: {e}", request.id, flush=True) raise e return task diff --git a/src/api/src/backend/views/ETLPipelines.py b/src/api/src/backend/views/ETLPipelines.py index f5886505..15ec6a62 100644 --- a/src/api/src/backend/views/ETLPipelines.py +++ b/src/api/src/backend/views/ETLPipelines.py @@ -261,6 +261,8 @@ def post(self, request, group_id, *_, **__): task_service.delete(tasks) return BadRequest(message=e.__cause__) except ServerError as e: + pipeline.delete() + task_service.delete(tasks) return ServerErrorResp(message=e) except Exception as e: task_service.delete(tasks)