JAL-1043 patch to show warning dialog when webservice exception is thrown
[jalview.git] / src / jalview / ws / jws2 / JabaWsServerQuery.java
index 2eb484b..6cca61b 100644 (file)
 package jalview.ws.jws2;
 
 import jalview.bin.Cache;
+import jalview.gui.Desktop;
 import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.jws2.jabaws2.Jws2InstanceFactory;
 
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.swing.JOptionPane;
+
 import compbio.data.msa.Category;
 import compbio.data.msa.JABAService;
 import compbio.ws.client.Jws2Client;
@@ -131,8 +134,13 @@ public class JabaWsServerQuery implements Runnable
             // svccategories.toString());
 
           }
-        } catch (Exception ex)
+        } catch (javax.xml.ws.WebServiceException ex)
         {
+          JOptionPane
+                  .showInternalMessageDialog(
+                          Desktop.desktop,
+                          "Exception whilst trying to access the webservice registry:",
+                          "Webservice glitch", JOptionPane.WARNING_MESSAGE);
           System.err.println("Exception whilst trying to get at registry:");
           ex.printStackTrace();
           // if that failed, then we are probably working with a JABAWS1 server.
@@ -144,6 +152,10 @@ public class JabaWsServerQuery implements Runnable
             srv_set.add(srv);
           }
         }
+ catch (Exception ex)
+        {
+          ex.printStackTrace();
+        }
         for (Category cat : categories)
         {
           for (Services srv : cat.getServices())