From 74e4d71835fd0031dd7c309e37ec6bf934e4de4a Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 5 Sep 2005 15:38:26 +0000 Subject: [PATCH] More informative error messages. --- src/jalview/ws/JPredClient.java | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/jalview/ws/JPredClient.java b/src/jalview/ws/JPredClient.java index 65f0325..4302df2 100755 --- a/src/jalview/ws/JPredClient.java +++ b/src/jalview/ws/JPredClient.java @@ -249,15 +249,15 @@ public class JPredClient } } } - - if (! (result.isJobFailed() || result.isServerError())) - { - wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_OK); - } - else - { - wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); - } + if (result!=null) + if (! (result.isJobFailed() || result.isServerError())) + { + wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_OK); + } + else + { + wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); + } } void StartJob() @@ -292,16 +292,17 @@ public class JPredClient catch (Exception e) { wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); - allowedServerExceptions = 0; - jobComplete = false; - - wsInfo.appendProgressText("Failed to submit the prediction.\n" - + - "It is most likely that there is a problem with the server.\n" - + "Just close the window\n"); + 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 (Probably a server error - see below)\n" + - e.toString() + "\n"); + "JPredWS Client: Failed to submit the prediction (Possibly a server error - see below)\n" + + e.getMessage() + "\n"); jalview.bin.Jalview.log.debug("Failed Submission",e); } -- 1.7.10.2