[whatwg/fetch] Should specify the error messages (#1147)

Example:
```JavaScript
const res = new Response('body');
res.text().then(() => res.text()).catch(e => console.log(`"${e.message}"`));
```

- Chrome 88: `"Failed to execute 'text' on 'Response': body stream already read"`
- Firefox 84: `"Response.text: Body has already been consumed."`
- GNOME Web 3.28.6 (WebKit 605.1.15): `"Body is disturbed or locked"`
- Microsoft Edge 44 (EdgeHTML 18): `"Body has already been read"`
- node-fetch 3.0.0-beta.9: `"body used already for: "`
- whatwg-fetch 3.5.0: `"Already read"`

The [standard](https://fetch.spec.whatwg.org/#body-mixin) is not precise enough: *"If object is disturbed or locked, then return a promise rejected with a TypeError."*

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

Received on Wednesday, 27 January 2021 11:26:17 UTC