Throw if response is not 2xx. Variant that parses error body as JSON.
The fetch Response to check.
An object containing response (the original Response if ok) and optionally errorBody (parsed JSON error body).
response
errorBody
If the response is not ok.
Throw if response is not 2xx. Variant that parses error body as JSON.