From 338fec5009a92d5cedc15612a13313bdb3f42756 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 5 Sep 2012 12:26:22 +0100 Subject: [PATCH] JAL-994 fix when sequence is too short and no jobs run --- src/jalview/ws/AWSThread.java | 2 ++ src/jalview/ws/jws1/JPredThread.java | 13 +++++++++++++ 2 files changed, 15 insertions(+) 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(); } } -- 1.7.10.2