Skip to content

Truncated stack trace from error thrown by scheduled job #228

Description

@andersk
import Bottleneck from "bottleneck";

const limiter = new Bottleneck();

async function inner() {
  await null;
  throw new Error("oops");
}

async function outer() {
  await limiter.schedule(inner);
}

await outer();

Here I’d like see a stack trace that mentions both outer and inner, but I only see inner. This makes it hard to debug issues where the bug is higher in the call stack.

file:///tmp/bottleneck-test/test.js:7
  throw new Error("oops");
        ^

Error: oops
    at Job.inner [as task] (file:///tmp/bottleneck-test/test.js:7:9)

Node.js v22.21.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions