Skip to content

Commit

Permalink
fix(job): add default err object fixes #2029
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Jul 15, 2021
1 parent c7d0e9e commit 39684e9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/job.js
Expand Up @@ -271,6 +271,8 @@ Job.prototype.discard = function() {
* @returns void
*/
Job.prototype.moveToFailed = async function(err, ignoreLock) {
err = err || { message: 'Unknown reason' };

this.failedReason = err.message;
await this.queue.isReady();

Expand Down

0 comments on commit 39684e9

Please sign in to comment.