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

Ambiguous definition/initial values of network error #379

Open
cyaugin opened this issue Aug 1, 2023 · 3 comments
Open

Ambiguous definition/initial values of network error #379

cyaugin opened this issue Aug 1, 2023 · 3 comments

Comments

@cyaugin
Copy link

cyaugin commented Aug 1, 2023

Per https://xhr.spec.whatwg.org/#interface-xmlhttprequest a response is said to be initialized as a network error, the definition of which is then linked to in the Fetch Standard (https://fetch.spec.whatwg.org/#concept-network-error). However, the definition given is specific to Fetch and its applicability to XHR is unclear, mainly because the valid response types have different values between Fetch and XHR (most notably in this case, the XMLHttpRequestResponseType enum cannot have the supposed initial value of error).

@annevk
Copy link
Member

annevk commented Aug 28, 2023

Could you elaborate? E.g., for https://xhr.spec.whatwg.org/#the-status-attribute it seems pretty clear to me that will be returning 0.

I'm not sure why you think the definition is specific to Fetch.

@cyaugin
Copy link
Author

cyaugin commented Aug 31, 2023

"the XMLHttpRequestResponseType enum cannot have the supposed initial value of error"

Can you address the context that was given? What is the initial value of the response type for a network error represented in XHR? https://xhr.spec.whatwg.org/#response-type says the initial value is the empty string, which is not 'error' as defined in Fetch. Why is the Fetch initialization of "network error" being referenced if it is not the same as XHR?

@annevk
Copy link
Member

annevk commented Aug 31, 2023

I'm not sure what you mean. Aren't those different fields altogether?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants