-
Notifications
You must be signed in to change notification settings - Fork 606
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
Failed to catch AbortError from undici.request
after server returns
#3736
Labels
bug
Something isn't working
Comments
undici.request
after header is consumed.undici.request
after server returns
metcoder95
added a commit
that referenced
this issue
Oct 16, 2024
7 tasks
metcoder95
added a commit
that referenced
this issue
Oct 16, 2024
5 tasks
Merged
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
The following minimum reproduction log
ignore error
andhey
and then the entire process crashes withprocess.processTicksAndRejections
. It seems that the abort error is leaked instead of being catched.Reproducible By
Expected Behavior
The above minimum reproduction should log
ignore error
andhey
and the process to exit with 0.Logs & Screenshots
Environment
Node.js 22.6.0 w/ undici 6.20.1
The error can be reproduced on both Linux and macOS.
Additional context
I am using
Promise.any
andundici.request
to perform requests to multiple mirror URLs to get the fastest response and abort the rest. I also have a local cache and will bail out of allundici.request
early if the fastest response matches certain criteria. I want to usetry { } catch { }
to catch the error and perform some logic.The text was updated successfully, but these errors were encountered: