From 8cebc2a36ab550e1ed363c38ec7734b6146ad642 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 29 Nov 2022 15:38:59 +0000 Subject: [PATCH] JAL-3066 catch exceptions and report slivka server discovery status on Console --- src/jalview/gui/SlivkaPreferences.java | 6 +++++- src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/SlivkaPreferences.java b/src/jalview/gui/SlivkaPreferences.java index a332b2b..71ff903 100644 --- a/src/jalview/gui/SlivkaPreferences.java +++ b/src/jalview/gui/SlivkaPreferences.java @@ -364,7 +364,11 @@ public class SlivkaPreferences extends JPanel urls.addAll(discoverer.getUrls()); for (String url : urls) { - statuses.add(discoverer.getStatusForUrl(url)); + try { + statuses.add(discoverer.getStatusForUrl(url)); + } catch (Throwable th) { + Console.warn("Problem when contacting slivka server at "+url,th); + } } } } diff --git a/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java b/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java index 9369c6b..d45b918 100644 --- a/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java +++ b/src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java @@ -88,18 +88,20 @@ public class SlivkaWSDiscoverer implements WSDiscovererI private List reloadServices() { - Console.info("Reloading Slivka services"); + Console.info("Reloading Slivka services - contacting "+getServiceUrls().size()+" services"); notifyServiceListeners(Collections.emptyList()); ArrayList instances = new ArrayList<>(); for (String url : getServiceUrls()) { + Console.debug("Contacting Slivka server at "+url); SlivkaClient client = new SlivkaClient(url); List services; try { services = client.getServices(); + Console.debug((services==null ? "No services at " : "Found "+services.size()+" services at ") + url); } catch (IOException e) { e.printStackTrace(); -- 1.7.10.2