Index: remoting/webapp/crd/js/xmpp_connection.js |
diff --git a/remoting/webapp/crd/js/xmpp_connection.js b/remoting/webapp/crd/js/xmpp_connection.js |
index 6f56f58da8474a8a22dff9ec89d69a5831c3d3c3..0579a2c766bf42685d32832ad164a83b51ab4bb5 100644 |
--- a/remoting/webapp/crd/js/xmpp_connection.js |
+++ b/remoting/webapp/crd/js/xmpp_connection.js |
@@ -39,7 +39,7 @@ remoting.XmppConnection = function() { |
/** @private */ |
this.jid_ = ''; |
/** @private */ |
- this.error_ = remoting.Error.NONE; |
+ this.error_ = remoting.Error.none(); |
}; |
/** |
@@ -74,7 +74,7 @@ remoting.XmppConnection.prototype.connect = |
base.debug.assert(this.state_ == remoting.SignalStrategy.State.NOT_CONNECTED); |
base.debug.assert(this.onStateChangedCallback_ != null); |
- this.error_ = remoting.Error.NONE; |
+ this.error_ = remoting.Error.none(); |
var hostnameAndPort = server.split(':', 2); |
this.server_ = hostnameAndPort[0]; |
this.port_ = |
@@ -111,8 +111,9 @@ remoting.XmppConnection.prototype.connect = |
this.socket_.connect(this.server_, this.port_) |
.then(this.onSocketConnected_.bind(this)) |
.catch(function(error) { |
- that.onError_(remoting.Error.NETWORK_FAILURE, |
- 'Failed to connect to ' + that.server_ + ': ' + error); |
+ that.onError_( |
+ new remoting.Error(remoting.Error.Tag.NETWORK_FAILURE), |
+ 'Failed to connect to ' + that.server_ + ': ' + error); |
}); |
}; |
@@ -192,8 +193,9 @@ remoting.XmppConnection.prototype.onReceive_ = function(data) { |
* @private |
*/ |
remoting.XmppConnection.prototype.onReceiveError_ = function(errorCode) { |
- this.onError_(remoting.Error.NETWORK_FAILURE, |
- 'Failed to receive from XMPP socket: ' + errorCode); |
+ this.onError_( |
+ new remoting.Error(remoting.Error.Tag.NETWORK_FAILURE), |
+ 'Failed to receive from XMPP socket: ' + errorCode); |
}; |
/** |
@@ -231,8 +233,9 @@ remoting.XmppConnection.prototype.flushSendQueue_ = function() { |
}) |
.catch(function(/** number */ error) { |
that.sendPending_ = false; |
- that.onError_(remoting.Error.NETWORK_FAILURE, |
- 'TCP write failed with error ' + error); |
+ that.onError_( |
+ new remoting.Error(remoting.Error.Tag.NETWORK_FAILURE), |
+ 'TCP write failed with error ' + error); |
}); |
}; |
@@ -279,8 +282,9 @@ remoting.XmppConnection.prototype.startTls_ = function() { |
}) |
.catch(function(/** number */ error) { |
that.startTlsPending_ = false; |
- that.onError_(remoting.Error.NETWORK_FAILURE, |
- 'Failed to start TLS: ' + error); |
+ that.onError_( |
+ new remoting.Error(remoting.Error.Tag.NETWORK_FAILURE), |
+ 'Failed to start TLS: ' + error); |
}); |
} |
@@ -313,7 +317,7 @@ remoting.XmppConnection.prototype.onIncomingStanza_ = function(stanza) { |
* @private |
*/ |
remoting.XmppConnection.prototype.onParserError_ = function(text) { |
- this.onError_(remoting.Error.UNEXPECTED, text); |
+ this.onError_(remoting.Error.unexpected(), text); |
} |
/** |