This aims to reduce code duplication and improve error handling consistency. There are some changes in behaviour but I believe they can be considered non-breaking as the old functionality is unlikely to have been relied upon:
Always reject the promise if the network request or response errors (previously some endpoints rejected if the request had an error, some if the response had an error, and most didn't handle errors at all leaving the promise unresolved)
If debugging is turned on, also log an error (previously some always logged, some never logged and some logged only if debugging was on)
Propagate promise rejections up the chain (previously some rejections were lost due to only resolutions being handled)
Always parse empty response as {} (previously only some endpoints did this)
This aims to reduce code duplication and improve error handling consistency. There are some changes in behaviour but I believe they can be considered non-breaking as the old functionality is unlikely to have been relied upon:
{}
(previously only some endpoints did this)