Skip to content

Invalid credentials results in empty list rather than error #415

@fhinkel

Description

@fhinkel

In 1.7, you would get an error if the credentials are invalid. Now the getBuckets() promise is resolved and it looks like you have no buckets. Is that behavior intended? I can't find it anywhere in the docs.

const Storage = require('@google-cloud/storage');

  // Invalid credentials
  const storage = new Storage({
    keyFilename: '/Users/foo.json'
  });

  // Makes an authenticated API request.
  storage
    .getBuckets()
    .then((results) => {
      const buckets = results[0];

      console.log('Buckets:');
      buckets.forEach((bucket) => {
        console.log(bucket.name);
      });
    })
    .catch((err) => {
      console.error('ERROR:', err);
      console.log('such error');
    });

Metadata

Metadata

Labels

api: storageIssues related to the googleapis/nodejs-storage API.needs more infoThis issue needs more information from the customer to proceed.status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions