From 103b2ddf505e1c97bbd40746da20fba2649d1d85 Mon Sep 17 00:00:00 2001 From: Anandkumar Patel Date: Thu, 13 Oct 2016 10:26:22 -0700 Subject: [PATCH] move this._addWorkerDataToError to before rollbar reporting --- src/worker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/worker.js b/src/worker.js index e1f6bec..f4f6e9d 100644 --- a/src/worker.js +++ b/src/worker.js @@ -229,6 +229,7 @@ class Worker { .finally(() => { this._incMonitor('ponos.finish-error', { result: 'retry-error' }) throw new WorkerStopError('final retry handler finished', { + originalError: err, queue: this.queue, job: this.job, attempt: this.attempt @@ -297,10 +298,10 @@ class Worker { .bind(this) .then(this._wrapTask) .then(this._handleTaskSuccess) - .catch(this._addWorkerDataToError) // If the type is TimeoutError, log and re-throw error .catch(TimeoutError, this._handleTimeoutError) .catch(this._enforceRetryLimit) + .catch(this._addWorkerDataToError) .catch((err) => { this.errorCat.report(err) throw err