From: jprocter Date: Wed, 5 Sep 2012 11:26:22 +0000 (+0100) Subject: JAL-994 fix when sequence is too short and no jobs run X-Git-Tag: Jalview_2_9~334 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=338fec5009a92d5cedc15612a13313bdb3f42756;p=jalview.git JAL-994 fix when sequence is too short and no jobs run --- diff --git a/src/jalview/ws/AWSThread.java b/src/jalview/ws/AWSThread.java index 7d174bc..7300462 100644 --- a/src/jalview/ws/AWSThread.java +++ b/src/jalview/ws/AWSThread.java @@ -208,6 +208,8 @@ public abstract class AWSThread extends Thread { Cache.log .debug("WebServiceJob poll loop finished with no jobs created."); + wsInfo.setStatus(wsInfo.STATE_STOPPED_ERROR); + wsInfo.appendProgressText("No jobs ran."); wsInfo.setFinishedNoResults(); } } diff --git a/src/jalview/ws/jws1/JPredThread.java b/src/jalview/ws/jws1/JPredThread.java index a478b87..88e6a71 100644 --- a/src/jalview/ws/jws1/JPredThread.java +++ b/src/jalview/ws/jws1/JPredThread.java @@ -268,6 +268,8 @@ class JPredThread extends JWS1Thread implements WSClientI sequence = new vamsas.objects.simple.Sequence(); sequence.setId(seq.getName()); sequence.setSeq(sq); + } else { + errorMessage = "Sequence is too short to predict with JPred - need at least 20 amino acids."; } } @@ -284,6 +286,11 @@ class JPredThread extends JWS1Thread implements WSClientI } } } + String errorMessage=""; + public String getValidationMessages() + { + return errorMessage+"\n"; + } } ext.vamsas.Jpred server; @@ -312,6 +319,8 @@ class JPredThread extends JWS1Thread implements WSClientI jobs = new WSJob[] { job }; job.setJobnum(0); + } else { + wsInfo.appendProgressText(job.getValidationMessages()); } } @@ -328,6 +337,8 @@ class JPredThread extends JWS1Thread implements WSClientI { job }; OutputHeader = wsInfo.getProgressText(); job.setJobnum(0); + } else { + wsInfo.appendProgressText(job.getValidationMessages()); } } @@ -451,6 +462,8 @@ class JPredThread extends JWS1Thread implements WSClientI } else { + wsInfo.setStatus(wsInfo.STATE_STOPPED_ERROR); + wsInfo.appendInfoText("No jobs ran."); wsInfo.setFinishedNoResults(); } }