fix error handling
This commit is contained in:
parent
9c2b9eb236
commit
3793023c81
1 changed files with 3 additions and 8 deletions
|
|
@ -247,18 +247,13 @@ Network.prototype._setupConnectionHandlers = function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
self.socket.on('message', self._onMessage);
|
self.socket.on('message', self._onMessage);
|
||||||
self.socket.on('error', self._handlePeerError);
|
self.socket.on('error', self._handleError);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Network.prototype._handlePeerError = function(err) {
|
Network.prototype._handleError = function(err) {
|
||||||
alert(err);
|
|
||||||
console.log('RECV ERROR: ', err);
|
console.log('RECV ERROR: ', err);
|
||||||
if (err.message.match(/Could\snot\sconnect\sto peer/)) {
|
this.criticalError = err.message;
|
||||||
this._checkAnyPeer();
|
|
||||||
} else {
|
|
||||||
this.criticalError = err.message;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Network.prototype._addCopayerMap = function(peerId, copayerId) {
|
Network.prototype._addCopayerMap = function(peerId, copayerId) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue