From 6343f7768f058998ad6ccc2e28faeedbdb58fe7b Mon Sep 17 00:00:00 2001 From: Kelvin Jin Date: Thu, 31 Aug 2017 10:23:31 -0700 Subject: [PATCH] Revert "error msg instead if the api key is invalid" This reverts commit 689a233b5155dd3eecb54c932f785a931519b32f. --- packages/error-reporting/README.md | 2 +- .../error-reporting/src/google-apis/auth-client.js | 13 ------------- .../test/unit/google-apis/auth-client.js | 1 - 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/error-reporting/README.md b/packages/error-reporting/README.md index f6cf2ebce335..fdf676b30d3d 100644 --- a/packages/error-reporting/README.md +++ b/packages/error-reporting/README.md @@ -164,7 +164,7 @@ If a key is provided, the module will not attempt to authenticate using the meth We recommend storing the API key in a file rather than hard-coding it into your application's source code. -**Note:** The Error Reporting instance will check if the provided API key is invalid shortly after it is instantiated. If the key is invalid, an error-level message will be logged. +**Note:** If the API key provided is invalid, an error will be logged the first time the Error Reporting instance attempts to report an error. To ensure that the API key is valid, you may want to attempt to trigger an error shortly after deploying your app. ## Configuration diff --git a/packages/error-reporting/src/google-apis/auth-client.js b/packages/error-reporting/src/google-apis/auth-client.js index 48209d0cefd1..affc731635a8 100644 --- a/packages/error-reporting/src/google-apis/auth-client.js +++ b/packages/error-reporting/src/google-apis/auth-client.js @@ -114,19 +114,6 @@ class RequestHandler extends common.Service { } }); } else { - this.request({ - uri: 'events:report', - qs: RequestHandler.manufactureQueryString(this._config.getKey()), - method: 'POST', - json: {} - }, (err, body, response) => { - if (err && err.message !== 'Message cannot be empty.') { - this._logger.error([ - 'Encountered an error while attempting to validate the provided', - 'API key' - ].join(' '), err); - } - }); that._logger.info('API key provided; skipping OAuth2 token request.'); } } diff --git a/packages/error-reporting/test/unit/google-apis/auth-client.js b/packages/error-reporting/test/unit/google-apis/auth-client.js index 3278a1c6a928..7ec319e34cf4 100644 --- a/packages/error-reporting/test/unit/google-apis/auth-client.js +++ b/packages/error-reporting/test/unit/google-apis/auth-client.js @@ -28,7 +28,6 @@ function verifyReportedMessage(config, errToReturn, expectedLogs) { cb(errToReturn); } }; - this.request = function() {}; } }