fix error popup on delete outdated tor files

This commit is contained in:
woodser 2024-07-06 08:45:28 -04:00
parent 9c359b5e29
commit ff0ccc21e2
2 changed files with 61 additions and 52 deletions

View file

@ -140,6 +140,8 @@ class RequestDataHandler implements MessageListener {
getDataRequestType = getDataRequest.getClass().getSimpleName(); getDataRequestType = getDataRequest.getClass().getSimpleName();
log.info("\n\n>> We send a {} to peer {}\n", getDataRequestType, nodeAddress); log.info("\n\n>> We send a {} to peer {}\n", getDataRequestType, nodeAddress);
networkNode.addMessageListener(this); networkNode.addMessageListener(this);
try {
SettableFuture<Connection> future = networkNode.sendMessage(nodeAddress, getDataRequest); SettableFuture<Connection> future = networkNode.sendMessage(nodeAddress, getDataRequest);
//noinspection UnstableApiUsage //noinspection UnstableApiUsage
Futures.addCallback(future, new FutureCallback<>() { Futures.addCallback(future, new FutureCallback<>() {
@ -167,6 +169,9 @@ class RequestDataHandler implements MessageListener {
} }
} }
}, MoreExecutors.directExecutor()); }, MoreExecutors.directExecutor());
} catch (Exception e) {
if (!networkNode.isShutDownStarted()) throw e;
}
} else { } else {
log.warn("We have stopped already. We ignore that requestData call."); log.warn("We have stopped already. We ignore that requestData call.");
} }

View file

@ -115,6 +115,7 @@ class PeerExchangeHandler implements MessageListener {
TIMEOUT, TimeUnit.SECONDS); TIMEOUT, TimeUnit.SECONDS);
} }
try {
SettableFuture<Connection> future = networkNode.sendMessage(nodeAddress, getPeersRequest); SettableFuture<Connection> future = networkNode.sendMessage(nodeAddress, getPeersRequest);
Futures.addCallback(future, new FutureCallback<Connection>() { Futures.addCallback(future, new FutureCallback<Connection>() {
@Override @Override
@ -144,6 +145,9 @@ class PeerExchangeHandler implements MessageListener {
} }
} }
}, MoreExecutors.directExecutor()); }, MoreExecutors.directExecutor());
} catch (Exception e) {
if (!networkNode.isShutDownStarted()) throw e;
}
} else { } else {
log.debug("My node address is still null at sendGetPeersRequest. We ignore that call."); log.debug("My node address is still null at sendGetPeersRequest. We ignore that call.");
} }