Index: remoting/webapp/crd/js/oauth2_api_impl.js |
diff --git a/remoting/webapp/crd/js/oauth2_api_impl.js b/remoting/webapp/crd/js/oauth2_api_impl.js |
index cf976e0293380cef0056eed2185069564f769a78..36d2fdce6c8abdf47ef81d8149d2313809b09e24 100644 |
--- a/remoting/webapp/crd/js/oauth2_api_impl.js |
+++ b/remoting/webapp/crd/js/oauth2_api_impl.js |
@@ -82,9 +82,8 @@ remoting.OAuth2ApiImpl.prototype.refreshAccessToken = function( |
// TODO(jamiewalch): Fix this once we're no longer using the trampoline. |
var tokens = JSON.parse(xhr.responseText); |
onDone(tokens['access_token'], tokens['expires_in']); |
- } catch (err) { |
- console.error('Invalid "token" response from server:', |
- /** @type {*} */ (err)); |
+ } catch (/** @type {Error} */ err) { |
+ console.error('Invalid "token" response from server:', err); |
onError(remoting.Error.UNEXPECTED); |
} |
} else { |
@@ -130,9 +129,8 @@ remoting.OAuth2ApiImpl.prototype.exchangeCodeForTokens = function( |
var tokens = JSON.parse(xhr.responseText); |
onDone(tokens['refresh_token'], |
tokens['access_token'], tokens['expires_in']); |
- } catch (err) { |
- console.error('Invalid "token" response from server:', |
- /** @type {*} */ (err)); |
+ } catch (/** @type {Error} */ err) { |
+ console.error('Invalid "token" response from server:', err); |
onError(remoting.Error.UNEXPECTED); |
} |
} else { |
@@ -169,9 +167,8 @@ remoting.OAuth2ApiImpl.prototype.getEmail = function(onDone, onError, token) { |
try { |
var result = JSON.parse(xhr.responseText); |
onDone(result['email']); |
- } catch (err) { |
- console.error('Invalid "userinfo" response from server:', |
- /** @type {*} */ (err)); |
+ } catch (/** @type {Error} */ err) { |
+ console.error('Invalid "userinfo" response from server:', err); |
onError(remoting.Error.UNEXPECTED); |
} |
} else { |
@@ -203,9 +200,8 @@ remoting.OAuth2ApiImpl.prototype.getUserInfo = |
try { |
var result = JSON.parse(xhr.responseText); |
onDone(result['email'], result['name']); |
- } catch (err) { |
- console.error('Invalid "userinfo" response from server:', |
- /** @type {*} */ (err)); |
+ } catch (/** @type {Error} */ err) { |
+ console.error('Invalid "userinfo" response from server:', err); |
onError(remoting.Error.UNEXPECTED); |
} |
} else { |