Index: remoting/webapp/base/js/client_session_factory.js |
diff --git a/remoting/webapp/base/js/client_session_factory.js b/remoting/webapp/base/js/client_session_factory.js |
index 249864e5bcfb71a1d445db5827d0ae692342ebe4..658d490c16f84d78a0447f33866022e05e2e29ab 100644 |
--- a/remoting/webapp/base/js/client_session_factory.js |
+++ b/remoting/webapp/base/js/client_session_factory.js |
@@ -52,7 +52,8 @@ remoting.ClientSessionFactory.prototype.createSession = |
var clientPlugin; |
function OnError(/** !remoting.Error */ error) { |
- logError(logger, error); |
+ logger.logSessionStateChange( |
+ remoting.ChromotingEvent.SessionState.CONNECTION_FAILED, error); |
base.dispose(signalStrategy); |
base.dispose(clientPlugin); |
throw error; |
@@ -64,14 +65,12 @@ remoting.ClientSessionFactory.prototype.createSession = |
return remoting.identity.getUserInfo(); |
}).then(function(/** {email: string, name: string} */ userInfo) { |
logger.logSessionStateChange( |
- remoting.ChromotingEvent.SessionState.SIGNALING, |
- remoting.ChromotingEvent.ConnectionError.NONE); |
+ remoting.ChromotingEvent.SessionState.SIGNALING); |
return connectSignaling(userInfo.email, token); |
}).then(function(/** remoting.SignalStrategy */ strategy) { |
signalStrategy = strategy; |
logger.logSessionStateChange( |
- remoting.ChromotingEvent.SessionState.CREATING_PLUGIN, |
- remoting.ChromotingEvent.ConnectionError.NONE); |
+ remoting.ChromotingEvent.SessionState.CREATING_PLUGIN); |
return createPlugin(that.container_, that.requiredCapabilities_); |
}).then(function(/** remoting.ClientPlugin */ plugin) { |
clientPlugin = plugin; |
@@ -124,31 +123,4 @@ function createPlugin(container, capabilities) { |
}); |
} |
-/** |
- * Converts |e| to remoting.ChromotingEvent.ConnectionError and logs |
- * it to the telemetry service. |
- * |
- * TODO(kelvinp): Move this block to remoting.SessionLogger and consolidate |
- * the code path with xmpp_error. |
- * |
- * @param {remoting.SessionLogger} logger |
- * @param {remoting.Error} e |
- */ |
-function logError(logger, e) { |
- var error = remoting.ChromotingEvent.ConnectionError.UNEXPECTED; |
- |
- if (e instanceof remoting.Error) { |
- error = e.toConnectionError(); |
- |
- if (e.hasTag(remoting.Error.Tag.MISSING_PLUGIN)) { |
- var pluginError = /** @type {string} */ (e.getDetail()); |
- console.assert(Boolean(pluginError), 'Missing plugin error string.'); |
- logger.setPluginError(pluginError); |
- } |
- } |
- |
- logger.logSessionStateChange( |
- remoting.ChromotingEvent.SessionState.CONNECTION_FAILED, error); |
-} |
- |
})(); |