Skip to content

Abort error name is incorrect #2371

@tal-rofe98

Description

@tal-rofe98

Describe the bug

  • Node.js version: v20.13.0
  • OS & version: IRRELEVANT
  • Got Package Version: 14.4.2

I have this simple script:

import got from "got";

await got("https://google.com", { signal: AbortSignal.timeout(1) }).catch((error) => console.log(error.name));

Obviously it times out immediately.

Actual behavior

The log is AbortError

...

Expected behavior

Should be TimeoutError. When I do:

await fetch("https://google.com", { signal: AbortSignal.timeout(1) }).catch((error) =>
	console.log(error.name),
);

It prints TimeoutError
...

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.

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