Re: [whatwg/fetch] Streaming upload (Issue #1438)

@annevk , @yutakahirano : I understand and respect that, even though I find it unfortunate. I below, I assume that it's implemented as @yutakahirano suggests.

However, the question above remains about server errors which happen early on, e.g. authentication. I am still not clear how a web app would know that it needs to re-authenticate.

@yutakahirano specced:
> cancel the session when we see 401 (as well as redirects).
> then return a [network error](https://fetch.spec.whatwg.org/#concept-network-error).

How would the caller be able to distinguish between a connection error, 401 auth error, and 302 redirect? Unfortunately, the "network error" spec specifies that the status message must be empty, so I wouldn't know how to get that information. The recovery action in each case needs to be different (e.g. get new OAuth2 token), so the caller needs to know which kind of error happened. How can the caller know which error it was?

One option would be to create a new "server error" (instead of "network error"), where the status message and code fields are populated. Or you could allow "network error" to have an error message and code. Or maybe you or somebody have a better idea.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1438#issuecomment-1163047257
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1438/1163047257@github.com>

Received on Wednesday, 22 June 2022 12:40:22 UTC