code: function parseError (res, cb) {
    const error = new Error(`Server responded with ${res.statusCode}`)
  
    streamToJsonValue(res, (err, payload) => {
      if (err) {
        return cb(err)
      }
  
      if (payload) {
        error.code = payload.Code
        error.message = payload.Message || payload.toString()
        error.type = payload.Type
      }
      cb(error)
    })
  }
docs: -- Internal