Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort error name is incorrect #2371

Open
2 tasks done
tal-rofe98 opened this issue Aug 7, 2024 · 0 comments
Open
2 tasks done

Abort error name is incorrect #2371

tal-rofe98 opened this issue Aug 7, 2024 · 0 comments

Comments

@tal-rofe98
Copy link

tal-rofe98 commented Aug 7, 2024

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.
@tal-rofe98 tal-rofe98 changed the title Abort error reasi Abort error name is incorrect Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant