+ console.error('Cannot decode JSON.', { res, body: res.body instanceof Buffer ? res.body.toString() : res.body })
+ throw err
+ }
+ }
+
+ if (res.text) {
+ try {
+ return JSON.parse(res.text)
+ } catch (err) {
+ console.error('Cannot decode json', { res, text: res.text })