[whatwg/fetch] Consider response.throwIfNotOk() (Issue #1679)

Python has https://requests.readthedocs.io/en/latest/_modules/requests/models/#Response.raise_for_status and it seems folks sometimes want something like that from `fetch()`. You can branch on `response.ok` already, but perhaps essentially asserting would be nicer?

(They really seem to expect it to reject automatically, but that's not something that makes sense for all callers.)

(Naming follows https://dom.spec.whatwg.org/#dom-abortsignal-throwifaborted.)

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

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

Received on Monday, 26 June 2023 12:37:21 UTC