[whatwg/fetch] How to expose the error from ReadableStream for Response methods? (Issue #1665)

Currently:

```js
new Response(new ReadableStream({
  pull(c) {
    c.error("oh");
  }
})).text()
```

Different browsers do different things; Firefox logs a console message (invisible to JS), Safari passes it to the message of DOMException (and thus objects may become `[object Object]`), and Chrome does not expose it in any way.

Should the spec define a way to do this? Maybe use the new [`error.cause`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause)?

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

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

Received on Friday, 2 June 2023 16:36:47 UTC