whatwg / xhr

XMLHttpRequest Standard

Home Page:https://xhr.spec.whatwg.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ambiguous definition/initial values of network error

cyaugin opened this issue · comments

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).

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.

"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?

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