From fc7a9c79090f7a4a73c57d602b6b7bc7aabc44c8 Mon Sep 17 00:00:00 2001 From: Gabriel Rosa Date: Wed, 26 Oct 2022 10:52:12 -0300 Subject: [PATCH] FIX: do not throw errors when deleting input or transformation on pipeline delete --- src/modules/pipelinesV2/pipelines.service.ts | 28 ++++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/modules/pipelinesV2/pipelines.service.ts b/src/modules/pipelinesV2/pipelines.service.ts index 21d456e..cdaac50 100644 --- a/src/modules/pipelinesV2/pipelines.service.ts +++ b/src/modules/pipelinesV2/pipelines.service.ts @@ -169,20 +169,32 @@ export class PipelinesService implements OnModuleInit { ? JSON.parse(pipeline.config.tables) : null; if (input) - await this.inputsService.remove({ - id: input.input_id, - info, - }); + await this.inputsService + .remove({ + id: input.input_id, + info, + }) + .catch((error) => + this.logger.error('Could not delete input', { + data: { input, error }, + }), + ); const transformations: { id: string }[] = pipeline.transformations ? JSON.parse(pipeline.transformations) : null; if (transformations && transformations.length) for (const transformation of transformations) { - await this.transformationsService.remove({ - id: transformation.id, - info, - }); + await this.transformationsService + .remove({ + id: transformation.id, + info, + }) + .catch((error) => + this.logger.error('Could not delete transformation', { + data: { transformation, error }, + }), + ); } }