-
Notifications
You must be signed in to change notification settings - Fork 341
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
Distinguishing between errors #25
Comments
This is kind of a giant unsolved problem in web APIs. I last contributed on es-discuss about this. /cc @sicking |
Yeah, I was also not able to make any progress here. Didn't seem like there was any form of agreement on what errors on the web should look like. |
The main reason we do not have granularity for "network error" (which results in On the server this is probably less of a concern. Perhaps just adding an expando on the |
@bitinn any thoughts? I'm inclined to close this. |
@annevk sure! just one question: did current browser-side Fetch implementation leak information about the cause of TypeError by sending different I am just wondering as our current implementation is to send different message so debugging is easier. |
@bitinn I'm not sure if they do, I hope not for what the specification calls network errors. Though I suppose they might safely distinguish between an invalid URL and network error in the message and maybe the specification should too at some point if JavaScript gains a decent way to do that. |
For #25 (comment), Chromium doesn't give the detailed reason of |
Since we are rejecting with a TypeError when the Response is type
error
(aka network error per spec), what's your suggestion on how to distinguish between unparseable url, broken location header, network timeout, redirect limit reached.Is checking error message the suggested way?
This might be less of a problem on client side, but when implemented on server side, once I allowed custom timeout and maximum redirect count, that error is no longer solely caused by remote resource, it can also be related to request config. This is a concern for debugging and logging purposes.
for server-side implementation, see node-fetch, also related to #20.
The text was updated successfully, but these errors were encountered: