From 478cdf5b2350d055e0da878c5f54ba5a8ae4af4b Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 20 Sep 2010 07:22:00 +0000 Subject: [PATCH] only indicate that job is broken if it wasn't submitted correctly --- src/jalview/ws/jws2/MsaWSThread.java | 38 ++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/jalview/ws/jws2/MsaWSThread.java b/src/jalview/ws/jws2/MsaWSThread.java index d2b4ce9..0049001 100644 --- a/src/jalview/ws/jws2/MsaWSThread.java +++ b/src/jalview/ws/jws2/MsaWSThread.java @@ -606,6 +606,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI j.setSubmitted(true); j.setSubjobComplete(false); // System.out.println(WsURL + " Job Id '" + jobId + "'"); + return; } else { @@ -630,8 +631,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI + _lex.getMessage()); wsInfo.warnUser(_lex.getMessage(), "Input is too big!"); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); - wsInfo.setStatus(j.getJobnum(), - WebserviceInfo.STATE_STOPPED_ERROR); + wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_ERROR); } catch (compbio.metadata.WrongParameterException _lex) { lex = _lex; @@ -640,10 +640,8 @@ class MsaWSThread extends AWS2Thread implements WSClientI + _lex.getMessage() + "\nPlease check to make sure you have used the correct parameter set for this service!\n"); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); - wsInfo.setStatus(j.getJobnum(), - WebserviceInfo.STATE_STOPPED_ERROR); - } - catch (Error e) + wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_ERROR); + } catch (Error e) { // For unexpected errors System.err @@ -654,8 +652,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_SERVERERROR); - } - catch (Exception e) + } catch (Exception e) { // For unexpected errors System.err @@ -668,13 +665,16 @@ class MsaWSThread extends AWS2Thread implements WSClientI WebserviceInfo.STATE_STOPPED_SERVERERROR); } finally { - // Boilerplate code here - // TODO: JBPNote catch timeout or other fault types explicitly + if (!j.isSubmitted()) + { + // Boilerplate code here + // TODO: JBPNote catch timeout or other fault types explicitly - j.setAllowedServerExceptions(0); - wsInfo.appendProgressText(j.getJobnum(), - "Failed to submit sequences for alignment.\n" - + "Just close the window\n"); + j.setAllowedServerExceptions(0); + wsInfo.appendProgressText(j.getJobnum(), + "Failed to submit sequences for alignment.\n" + + "Just close the window\n"); + } } } @@ -712,11 +712,13 @@ class MsaWSThread extends AWS2Thread implements WSClientI msjob.alignment = server.getResult(msjob.getJobId()); } catch (compbio.metadata.ResultNotAvailableException e) { - // job has failed for some reason - probably due to invalid parameters - Cache.log.debug("Results not available for finished job - marking as broken job.",e); + // job has failed for some reason - probably due to invalid + // parameters + Cache.log + .debug("Results not available for finished job - marking as broken job.", + e); msjob.setjobStatus(JobStatus.FAILED); - } - catch (Exception e) + } catch (Exception e) { Cache.log.error("Couldn't get Alignment for job.", e); // TODO: Increment count and retry ? -- 1.7.10.2