Fixed so job submission and job failure errors are reported to user and server except...
authorjprocter <Jim Procter>
Thu, 15 Sep 2005 11:16:12 +0000 (11:16 +0000)
committerjprocter <Jim Procter>
Thu, 15 Sep 2005 11:16:12 +0000 (11:16 +0000)
src/jalview/ws/JPredClient.java

index 9fe7e27..45e331a 100755 (executable)
@@ -304,20 +304,30 @@ public class JPredClient
       }\r
       catch (Exception e)\r
       {\r
-        wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);\r
+        if (e.getMessage().indexOf("Exception")>-1) {\r
+          wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);\r
+          wsInfo.setProgressText(\r
+              "Failed to submit the prediction. (Just close the window)\n"\r
+              +\r
+              "It is most likely that there is a problem with the server.\n");\r
+          System.err.println(\r
+              "JPredWS Client: Failed to submit the prediction. Quite possibly because of a server error - see below)\n" +\r
+              e.getMessage() + "\n");\r
+\r
+          jalview.bin.Cache.log.warn("Server Exception",e);\r
+        } else {\r
+          wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);\r
+          // JBPNote - this could be a popup informing the user of the problem.\r
+          wsInfo.setProgressText("Failed to submit the prediction:\n"\r
+                                 +e.getMessage()+\r
+                                 wsInfo.getProgressText());\r
+\r
+          jalview.bin.Cache.log.debug("Failed Submission",e);\r
+\r
+        }\r
         allowedServerExceptions = -1;\r
         jobComplete = true;\r
 \r
-        wsInfo.setProgressText("Failed to submit the prediction. (Just close the window)\n"\r
-                                  + ((e.getMessage().indexOf("Exception")>-1) ? (\r
-                                  "It is most likely that there is a problem with the server.\n")\r
-                              : e.getMessage())\r
-                                  +wsInfo.getProgressText());\r
-        System.err.println(\r
-            "JPredWS Client: Failed to submit the prediction (Possibly a server error - see below)\n" +\r
-            e.getMessage() + "\n");\r
-\r
-        jalview.bin.Cache.log.debug("Failed Submission",e);\r
       }\r
     }\r
 \r