JAL-3066 catch exceptions and report slivka server discovery status on Console
authorJim Procter <j.procter@dundee.ac.uk>
Tue, 29 Nov 2022 15:38:59 +0000 (15:38 +0000)
committerJim Procter <j.procter@dundee.ac.uk>
Tue, 29 Nov 2022 15:38:59 +0000 (15:38 +0000)
src/jalview/gui/SlivkaPreferences.java
src/jalview/ws/slivkaws/SlivkaWSDiscoverer.java

index a332b2b..71ff903 100644 (file)
@@ -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);
+       }
     }
   }
 }
index 9369c6b..d45b918 100644 (file)
@@ -88,18 +88,20 @@ public class SlivkaWSDiscoverer implements WSDiscovererI
 
   private List<ServiceWithParameters> reloadServices()
   {
-    Console.info("Reloading Slivka services");
+    Console.info("Reloading Slivka services - contacting "+getServiceUrls().size()+" services");
     notifyServiceListeners(Collections.emptyList());
     ArrayList<ServiceWithParameters> instances = new ArrayList<>();
 
     for (String url : getServiceUrls())
     {
+      Console.debug("Contacting Slivka server at "+url);
       SlivkaClient client = new SlivkaClient(url);
 
       List<SlivkaService> services;
       try
       {
         services = client.getServices();
+       Console.debug((services==null ? "No services at " : "Found "+services.size()+" services at ") + url); 
       } catch (IOException e)
       {
         e.printStackTrace();