diff --git a/src/classes/job.ts b/src/classes/job.ts index 965aa8c79a..978671c222 100644 --- a/src/classes/job.ts +++ b/src/classes/job.ts @@ -1231,7 +1231,7 @@ export class Job< if (err?.stack) { this.stacktrace.push(err.stack); if (this.opts.stackTraceLimit) { - this.stacktrace = this.stacktrace.slice(0, this.opts.stackTraceLimit); + this.stacktrace = this.stacktrace.slice(-this.opts.stackTraceLimit); } }