From 422dbb549b89428edacd6b80a90b084fdfc0e96a Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 13 Jul 2017 14:50:16 -0400 Subject: [PATCH] catch network-unreachable error in dht protocol --- lbrynet/dht/protocol.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lbrynet/dht/protocol.py b/lbrynet/dht/protocol.py index d17a8befb..ba7aba586 100644 --- a/lbrynet/dht/protocol.py +++ b/lbrynet/dht/protocol.py @@ -367,7 +367,11 @@ class KademliaProtocol(protocol.DatagramProtocol): # i'm scared this may swallow important errors, but i get a million of these # on Linux and it doesnt seem to affect anything -grin log.debug("Can't send data to dht: EWOULDBLOCK") + elif err.errno == errno.ENETUNREACH: + # this should probably try to retransmit when the network connection is back + log.error("Network is unreachable") else: + log.error("DHT socket error: %s (%i)", err.message, err.errno) raise err def _sendResponse(self, contact, rpcID, response):