Skip to content

No stack trace on AbortSignal.timeout error #25182

@richgled

Description

@richgled

What version of Bun is running?

1.3.3+274e01c73

What platform is your computer?

Linux 6.14.0-36-generic x86_64 x86_64

What steps can reproduce the bug?

Run the following using bun:
test.js

bun test.js

What is the expected behavior?

When running the same function in node, the output contains a fully formed stack trace and error:

DOMException [TimeoutError]: The operation was aborted due to timeout
    at node:internal/deps/undici/undici:13510:13
    at async myfunc (file:///home/rich/my-repo/test.js:5:5)
    at async file:///home/rich/my-repo/test.js:15:1 {
  [stack]: [Getter/Setter],
  name: [Getter],
  message: [Getter],
  code: [Getter],
  INDEX_SIZE_ERR: 1,
  DOMSTRING_SIZE_ERR: 2,
  HIERARCHY_REQUEST_ERR: 3,
  WRONG_DOCUMENT_ERR: 4,
  INVALID_CHARACTER_ERR: 5,
  NO_DATA_ALLOWED_ERR: 6,
  NO_MODIFICATION_ALLOWED_ERR: 7,
  NOT_FOUND_ERR: 8,
  NOT_SUPPORTED_ERR: 9,
  INUSE_ATTRIBUTE_ERR: 10,
  INVALID_STATE_ERR: 11,
  SYNTAX_ERR: 12,
  INVALID_MODIFICATION_ERR: 13,
  NAMESPACE_ERR: 14,
  INVALID_ACCESS_ERR: 15,
  VALIDATION_ERR: 16,
  TYPE_MISMATCH_ERR: 17,
  SECURITY_ERR: 18,
  NETWORK_ERR: 19,
  ABORT_ERR: 20,
  URL_MISMATCH_ERR: 21,
  QUOTA_EXCEEDED_ERR: 22,
  TIMEOUT_ERR: 23,
  INVALID_NODE_TYPE_ERR: 24,
  DATA_CLONE_ERR: 25,
  [Symbol(Symbol.toStringTag)]: 'DOMException'
}

error.stack:

TimeoutError: The operation was aborted due to timeout
    at node:internal/deps/undici/undici:13510:13
    at async myfunc (file:///home/rich/my-repo/test.js:5:5)
    at async file:///home/rich/my-repo/test.js:16:1

What do you see instead?

Output from bun:

[DOMException [TimeoutError]: The operation timed out.] { [stack]: '' }

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions