From a625fd85de5cea7f3bf3cc58c00a1ed797208c80 Mon Sep 17 00:00:00 2001 From: ronshv Date: Wed, 13 Mar 2024 14:19:33 +0200 Subject: [PATCH] adding try-catch block to prevent crashes --- core/pipeline-driver/lib/tasks/task-runner.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/pipeline-driver/lib/tasks/task-runner.js b/core/pipeline-driver/lib/tasks/task-runner.js index 18bca39ca..3273258d3 100644 --- a/core/pipeline-driver/lib/tasks/task-runner.js +++ b/core/pipeline-driver/lib/tasks/task-runner.js @@ -879,8 +879,13 @@ class TaskRunner { } log.debug(`task ${status} ${taskId} ${error || ''}`, { component, jobId: this._jobId, pipelineName: this.pipeline.name, taskId }); - this._progress.debug({ jobId: this._jobId, pipeline: this.pipeline.name, status: DriverStates.ACTIVE }); - this._boards.update(task); + try { + this._progress.debug({ jobId: this._jobId, pipeline: this.pipeline.name, status: DriverStates.ACTIVE }); + this._boards.update(task); + } + catch (e) { + log.error(`jobId: ${this._jobId}, pipeline name: ${this.pipeline.name}, ${e.message}`, { component, jobId: this._jobId, pipelineName: this.pipeline.name, taskId }); + } } // TODO: MAKE THIS THROW @@ -891,7 +896,7 @@ class TaskRunner { this._nodes.updateTaskState(taskId, state); } catch (e) { - log.error(`jobId: ${this._jobId}, ${e.message}`, { component, jobId: this._jobId, pipelineName: this.pipeline.name, taskId }); + log.error(`jobId: ${this._jobId}, pipeline name: ${this.pipeline.name}, ${e.message}`, { component, jobId: this._jobId, pipelineName: this.pipeline.name, taskId }); } }