fix error handling

This commit is contained in:
Manuel Araoz 2014-08-07 19:02:01 -03:00
parent 9c2b9eb236
commit 3793023c81
1 changed files with 3 additions and 8 deletions

View File

@ -247,18 +247,13 @@ Network.prototype._setupConnectionHandlers = function() {
});
});
self.socket.on('message', self._onMessage);
self.socket.on('error', self._handlePeerError);
self.socket.on('error', self._handleError);
};
Network.prototype._handlePeerError = function(err) {
alert(err);
Network.prototype._handleError = function(err) {
console.log('RECV ERROR: ', err);
if (err.message.match(/Could\snot\sconnect\sto peer/)) {
this._checkAnyPeer();
} else {
this.criticalError = err.message;
}
};
Network.prototype._addCopayerMap = function(peerId, copayerId) {