Skip to content

Commit

Permalink
fix: simplify logic for stackTraceLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
stansv committed Oct 27, 2019
1 parent 85dfe52 commit 296bd89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/classes/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,10 @@ export class Job {
this.attemptsMade++;
this.stacktrace = this.stacktrace || [];

this.stacktrace.push(err.stack);
if (this.opts.stackTraceLimit) {
this.stacktrace = this.stacktrace.slice(0, this.opts.stackTraceLimit - 1);
this.stacktrace = this.stacktrace.slice(0, this.opts.stackTraceLimit);
}
this.stacktrace.push(err.stack);

const params = {
attemptsMade: this.attemptsMade,
Expand Down

0 comments on commit 296bd89

Please sign in to comment.