-
Notifications
You must be signed in to change notification settings - Fork 572
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
[Regression] #fetch() is now returning generic terminated
error message in some cases
#1140
Comments
We follow the spec quite literally. fetch is not very good at forwarding error causes. You have the same problem in Chrome. We do implement diagnostic channels which might help getting more useful information. Otherwise, if you are using node and don't need web compat I would recommend you use the |
@ronag - Can you confirm whether these types of changes are considered bugs/regressions in terms of version bumps? Even though this change seemingly aligned with Chrome's implementation, it still seems to be a borderline breaking change. Would you also happen to have a link to the spec where it states the error message must be XYZ? I understand this project's goal of matching the behavior of Chrome, but intentionally making the errors less useful seems odd to me. Matching the error types, codes, etc. all makes sense, but I'm having a hard time how returning back a string of "terminated" would ever be a preferred state. Anyways, I am using node so it looks like switching from EDIT: With a little more time to think... There are basically two "specs" here. The first is the fetch spec itself, which as far as I'm aware doesn't prevent additional things from being exposed (e.g. While I understand the stated goals of trying to stay aligned with Chrome, I suppose my confusion is more focused on certain changes like this that, at least at first glance, are almost objectively worse behavior/functionality at least in a practical sense. This looks like a case of adherence to Chrome for sake of adherence to Chrome without any real benefits. |
Anything that is beyond the spec is IMO not breaking. Anyway, I don't know if you noticed. We've actually fixed this now so that the error is forwarded in cause. I can cut a release for you it it's urgent. |
If you want please open a PR to test for this behaviour and that way we are less likely to change this again. |
Thanks for the fix, and not urgent, but appreciate the offer. I'll definitely make a mental note to see if I can loop back to this sometime in January to add a few tests. Thanks! |
Bug Description
It seems like
#fetch()
is returning different (i.e. less useful) error messages starting in4.11.2
. I'm not exactly sure which change caused it or if it was intentional, but it's now just returning a super genericterminated
error message in some cases. Is there any way to access the root cause / detailed description ofgetaddrinfo ENOTFOUND not-real-subdomain.github23.com
in the below example?Reproducible by
npm install [email protected]
require('undici').fetch('https://not-real-subdomain.github23.com').catch(console.log)
Pre-4.11.2 behavior
Post-4.11.2 behavior
Environment
[email protected]
The text was updated successfully, but these errors were encountered: