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

use AbortSignal.timeout() when available #80

Open
alexkli opened this issue Apr 23, 2022 · 0 comments
Open

use AbortSignal.timeout() when available #80

alexkli opened this issue Apr 23, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@alexkli
Copy link
Contributor

alexkli commented Apr 23, 2022

This would give a nicer message than the current The user aborted a request. which is confusing when in fact it is a timeout:

AbortError failed with type: aborted; message: The user aborted a request.
Retrying in 129 milliseconds, attempt 1 error: AbortError, The user aborted a request.

MDN doc of AbortSignal.timeout(): https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout

WhatWG spec: https://dom.spec.whatwg.org/#interface-AbortSignal

Available in nodejs 16.14+: https://nodejs.org/dist/latest-v16.x/docs/api/globals.html#class-abortcontroller

Unfortunately the abort-controller library we use doesn't support it yet, neither do the other AbortController libraries on npm that I found (at this time).

@alexkli alexkli added the enhancement New feature or request label Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant