New issue
Advanced search Search tips

Issue 777487 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 577097
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Response.text doesn't include rejection from ReadableStream

Project Member Reported by rsk@google.com, Oct 23 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36

Steps to reproduce the problem:
1. Create a Response with a ReadableStream that rejects:

  const response = new Response(new ReadableStream({                                        
    pull: (controller) => Promise.reject(Error('some reason'))                            
  }));  

2. Call Response.text() to extract the text:

  const text = await response.text()

   or

  response.text().then(
    (text) => { ... },
    (err) => { ... });

What is the expected behavior?
I expect the error to be "Error: some reason".

What went wrong?
All we get is the generic "TypeError: Failed to fetch"

Did this work before? N/A 

Chrome version: 62.0.3202.62  Channel: stable
OS Version: 4.4.0-97-generic
Flash Version:
 
Components: -Blink Blink>Network>StreamsAPI
Labels: Needs-Triage-M62 Hotlist-Google
Owner: yhirano@chromium.org
Status: Untriaged (was: Unconfirmed)
Confirmed this is a Chrome bug and the spec supports the expected behavior. https://fetch.spec.whatwg.org/#concept-read-all-bytes-from-readablestream step 3 last bullet point. Tentatively assigning to yhirano@ for further triage.
The fix here should include web platform tests BTW :)
Mergedinto: 577097
Status: Duplicate (was: Untriaged)

Sign in to add a comment