ClusterManager.listBuckets does not handle 401 errors


#1

The error handling in ClusterManager.listBuckets, doesn’t account for the case where the response body is empty, which is the case when authentication fails, and 401 is returned.

if (resp.statusCode !== 200) {
  var errData = JSON.parse(data);
  return callback(new Error(errData.reason), null);
}