whatwg / xhr

XMLHttpRequest Standard
https://xhr.spec.whatwg.org/
Other
314 stars 129 forks source link

Ambiguous definition/initial values of network error #379

Open cyaugin opened 1 year ago

cyaugin commented 1 year ago

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 commented 1 year ago

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 commented 12 months ago

"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 commented 12 months ago

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