From 1a3a814fb893d185deeaaaf694fbb91488b2bff4 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 15 Sep 2005 11:16:12 +0000 Subject: [PATCH] Fixed so job submission and job failure errors are reported to user and server exceptions also generate error and log messages. --- src/jalview/ws/JPredClient.java | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/jalview/ws/JPredClient.java b/src/jalview/ws/JPredClient.java index 9fe7e27..45e331a 100755 --- a/src/jalview/ws/JPredClient.java +++ b/src/jalview/ws/JPredClient.java @@ -304,20 +304,30 @@ public class JPredClient } catch (Exception e) { - wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); + if (e.getMessage().indexOf("Exception")>-1) { + wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); + wsInfo.setProgressText( + "Failed to submit the prediction. (Just close the window)\n" + + + "It is most likely that there is a problem with the server.\n"); + System.err.println( + "JPredWS Client: Failed to submit the prediction. Quite possibly because of a server error - see below)\n" + + e.getMessage() + "\n"); + + jalview.bin.Cache.log.warn("Server Exception",e); + } else { + wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); + // JBPNote - this could be a popup informing the user of the problem. + wsInfo.setProgressText("Failed to submit the prediction:\n" + +e.getMessage()+ + wsInfo.getProgressText()); + + jalview.bin.Cache.log.debug("Failed Submission",e); + + } allowedServerExceptions = -1; jobComplete = true; - wsInfo.setProgressText("Failed to submit the prediction. (Just close the window)\n" - + ((e.getMessage().indexOf("Exception")>-1) ? ( - "It is most likely that there is a problem with the server.\n") - : e.getMessage()) - +wsInfo.getProgressText()); - System.err.println( - "JPredWS Client: Failed to submit the prediction (Possibly a server error - see below)\n" + - e.getMessage() + "\n"); - - jalview.bin.Cache.log.debug("Failed Submission",e); } } -- 1.7.10.2