From aa5ea72e3b36aa7bf120303455fe585149141941 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Tue, 10 May 2016 17:24:05 -0700 Subject: [PATCH] swollow errors saving job output, include error in debugging output --- src/worker.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/worker.js b/src/worker.js index 64c6994..f2af1d7 100644 --- a/src/worker.js +++ b/src/worker.js @@ -149,7 +149,8 @@ export default class Job extends events.EventEmitter { }) .catch((err) => { if (err.statusCode === 409) return false; - throw err; + this.debug(`Failure saving job output ${job._id}`, err); + this.emit('job_error', err); }); }, (jobErr) => { // job execution failed @@ -159,7 +160,7 @@ export default class Job extends events.EventEmitter { return; } - this.debug(`Failure occurred on job ${job._id}`); + this.debug(`Failure occurred on job ${job._id}`, jobErr); this.emit('job_error', jobErr); return this._failJob(job, jobErr.toString()); });