Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

nodejs: do not throw unhandled rejection#2565

Merged
alexander-fenster merged 1 commit intomasterfrom
nodejs-no-unhandled-rejection
Feb 13, 2019
Merged

nodejs: do not throw unhandled rejection#2565
alexander-fenster merged 1 commit intomasterfrom
nodejs-no-unhandled-rejection

Conversation

@alexander-fenster
Copy link
Contributor

Fixes #2065, googleapis/nodejs-text-to-speech#12, and https://github.com/googleapis/gax-nodejs/issues/121.

I originally expected to fix it in the new TypeScript generator but since the quick fix is easy and many users are affected, let's just do it here. If any stub cannot be initialized for whatever reason (invalid path to credentials file is one possible reason), we'll not fail the constructor, but all the stubs will throw when called. The difference is that those exceptions can be caught by users.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node.js: UnhandledPromiseRejection in createStub when keyfile path doesn't exist

2 participants