Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve missing project ID error stack trace #2068

Closed
gajus opened this issue Mar 9, 2017 · 2 comments
Closed

Preserve missing project ID error stack trace #2068

gajus opened this issue Mar 9, 2017 · 2 comments
Assignees
Labels

Comments

@gajus
Copy link

gajus commented Mar 9, 2017

I am referring to:

https://github.com/GoogleCloudPlatform/google-cloud-node/blob/1939deaa32298b3cbe123686e5c52f480c1d7ee2/packages/common/src/util.js#L55

Error stack trace is captured at the time of constructing the Error instance.

As a result, the error stack trace does not relate to the origin site of the error, e.g.

Error: Sorry, we cannot connect to Cloud Services without a project ID. You may specify one with an environment variable named "GCLOUD_PROJECT". See https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/authentication for a detailed guide on creating an authenticated connection.
    at Object.<anonymous> (/Users/gajus/Documents/dev/applaudience/movie-editor/node_modules/google-cloud/node_modules/@google-cloud/common/src/util.js:55:29)
    at Module._compile (module.js:571:32)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/gajus/Documents/dev/applaudience/movie-editor/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gajus/Documents/dev/applaudience/movie-editor/node_modules/google-cloud/node_modules/@google-cloud/common/src/service-object.js:32:12)

Consider using the following approach to construct errors:

https://github.com/gajus/xfetch/blob/0d8cd012354b0bb8b67162f74b2a9e126d3bdabb/src/errors.js

@stephenplusplus stephenplusplus changed the title Do not pre-construct error Preserve missing project ID error stack trace Mar 14, 2017
@lukesneeringer lukesneeringer added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Apr 19, 2017
@evaogbe
Copy link
Contributor

evaogbe commented Aug 7, 2017

Thanks for filing this issue. We agree that this would be a good issue to fix, and we invite you or another community member to contribute a pull request (PR), which we would be happy to review.

@stephenplusplus
Copy link
Contributor

This issue was moved to googleapis/nodejs-common#12.

@stephenplusplus stephenplusplus removed priority: p2 Moderately-important priority. Fix may not be included in next release. type: enhancement labels Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants