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

Bad credentials (or missing) throws UnhandledPromiseRejectionWarning #403

Closed
kidplug opened this issue Jan 25, 2019 · 4 comments
Closed
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@kidplug
Copy link

kidplug commented Jan 25, 2019

When creating a new SpeechClient (specifically using keyFilename), and the file does not exist:

' new speech.SpeechClient({keyFile:"my.json"});'

causes:
UnhandledPromiseRejectionWarning

How is the caller supposed to catch or handle this? Does the returned SpeechClient object expose a promise that can be acted upon?

@kidplug kidplug changed the title Bad credentials (or missing) throws unhandledRejection Bad credentials (or missing) throws UnhandledPromiseRejectionWarning Jan 25, 2019
@kidplug
Copy link
Author

kidplug commented Jan 25, 2019

@JustinBeckwith JustinBeckwith transferred this issue from googleapis/nodejs-speech Jan 31, 2019
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jan 31, 2019
@JustinBeckwith
Copy link
Contributor

I actually tracked this down in gax. The offending code is here:
https://github.com/googleapis/gax-nodejs/blob/master/src/api_callable.ts#L400

The funcWithAuth function is throwing without a handler. I think this function is dynamically generated, which makes tracking this down very hard.

I'm adding another chip to #401

@JustinBeckwith JustinBeckwith added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 31, 2019
@yoshi-automation yoshi-automation removed triage me I really want to be triaged. 🚨 This issue needs some love. labels Jan 31, 2019
@alexander-fenster
Copy link
Contributor

This is a dup of googleapis/gapic-generator#2065. I was under impression it can be fixed by changing the generated library code, hence the issue I referred to is in the generator. Do you feel comfortable if I close it here?

@alexander-fenster
Copy link
Contributor

Fixed by googleapis/gapic-generator#2565.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants