From 8f9b1e5a8bdac2658e8833cd1a71b21c455b2d0d Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Tue, 24 Dec 2019 17:05:36 +0000 Subject: [PATCH] supress exceptions if client is stopped --- .../groovy/com/muwire/core/hostcache/CacheClient.groovy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/hostcache/CacheClient.groovy b/core/src/main/groovy/com/muwire/core/hostcache/CacheClient.groovy index 673232dc..64056486 100644 --- a/core/src/main/groovy/com/muwire/core/hostcache/CacheClient.groovy +++ b/core/src/main/groovy/com/muwire/core/hostcache/CacheClient.groovy @@ -71,7 +71,12 @@ class CacheClient { options.setSendLeaseSet(true) CacheServers.getCacheServers().each { log.info "Querying hostcache ${it.toBase32()}" - session.sendMessage(it, ping, 0, ping.length, I2PSession.PROTO_DATAGRAM, 1, 0, options) + try { + session.sendMessage(it, ping, 0, ping.length, I2PSession.PROTO_DATAGRAM, 1, 0, options) + } catch (Exception e) { + if (!stopped.get()) + throw e + } } }