-
Notifications
You must be signed in to change notification settings - Fork 642
error-reporting: Warn early if cannot access API #2252
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
error-reporting: Warn early if cannot access API #2252
Conversation
An attempt will be made to communicate with the API as soon as the error reporting library is loaded so that the user will be notified on application start if the error reporting library cannot communicate with the API. Without this change, the user will instead receive a warning only when the error reporting library attempts to report its first error.
kjin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ minor comments.
| that._logger.warn([ | ||
| 'Unable to find credential information on instance. This library ' + | ||
| 'will be unable to communicate with the Stackdriver API to save ' + | ||
| 'errors. Message: ' + err.message |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| }; | ||
| var config = new Configuration({ ignoreEnvironmentCheck: true }, logger); | ||
| new RequestHandler(config, logger); | ||
| assert.strictEqual(warnText, expectedWarn); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| var that = this; | ||
| this.authClient.getToken(function(err, token) { | ||
| if (err) { | ||
| that._logger.warn([ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* error-reporting: Warn early if cannot access API An attempt will be made to communicate with the API as soon as the error reporting library is loaded so that the user will be notified on application start if the error reporting library cannot communicate with the API. Without this change, the user will instead receive a warning only when the error reporting library attempts to report its first error. * Add tests to verify successful communication * Address GitHub comments
* error-reporting: Warn early if cannot access API An attempt will be made to communicate with the API as soon as the error reporting library is loaded so that the user will be notified on application start if the error reporting library cannot communicate with the API. Without this change, the user will instead receive a warning only when the error reporting library attempts to report its first error. * Add tests to verify successful communication * Address GitHub comments
* error-reporting: Warn early if cannot access API An attempt will be made to communicate with the API as soon as the error reporting library is loaded so that the user will be notified on application start if the error reporting library cannot communicate with the API. Without this change, the user will instead receive a warning only when the error reporting library attempts to report its first error. * Add tests to verify successful communication * Address GitHub comments
An attempt will be made to communicate with the API as soon as
the error reporting library is loaded so that the user will be
notified on application start if the error reporting library
cannot communicate with the API.
Without this change, the user will instead receive a warning
only when the error reporting library attempts to report its first
error.