Our initial request logic would just take whatever the json response payload was and attempt to resolve it as the desired interface value. I've added in a function jsonify which will check for response.ok and throw otherwise.
Callouts
This workaround is still very lightweight. When dealing with more complicated request logic, take consideration in handling multiple non-ok response codes as well as ok type response codes that may produce varying results that still need errors.
Purpose
jsonify
which will check forresponse.ok
and throw otherwise.Callouts
ok
type response codes that may produce varying results that still need errors.