Handle ws errors on send/ping

This commit is contained in:
maciejhirsz
2018-07-26 17:25:29 +02:00
parent a8f0081385
commit 20d8b21adc
2 changed files with 23 additions and 3 deletions
+8 -1
View File
@@ -243,7 +243,14 @@ export default class Node {
// }
this.pingStart = now;
this.socket.ping(noop);
try {
this.socket.ping(noop);
} catch (err) {
console.error('Failed to send ping to Node', err);
this.disconnect();
}
}
private updateBestBlock(update: BestBlock) {