Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: remoting/webapp/wcs.js

Issue 10207028: Fixed callWithToken error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer feedback. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/oauth2.js ('k') | remoting/webapp/wcs_loader.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/wcs.js
diff --git a/remoting/webapp/wcs.js b/remoting/webapp/wcs.js
index e2bb9d7f8284cfba76760857d22311a0a1e9b841..25fbbe05884b8bca2f575f2efc66b66c1a3e8330 100644
--- a/remoting/webapp/wcs.js
+++ b/remoting/webapp/wcs.js
@@ -61,9 +61,14 @@ remoting.Wcs = function(wcsIqClient, token, onReady) {
*/
this.pollForUpdatedToken_ = setInterval(
function() {
- /** @param {string} token */
+ /** @param {string?} token */
var updateAccessToken = function(token) {
- that.updateAccessToken_(token);
+ if (token) {
+ that.updateAccessToken_(token);
+ } else {
+ console.error('pollForUpdatedToken: Authentication failed.');
+ // No need to update the token. The hanging GET will fail anyway.
+ }
}
remoting.oauth2.callWithToken(updateAccessToken);
},
« no previous file with comments | « remoting/webapp/oauth2.js ('k') | remoting/webapp/wcs_loader.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698