reflect the state of a failed Job in the GUI (e.g. trying to align protein seqs with...
authorjprocter <Jim Procter>
Thu, 16 Sep 2010 11:54:27 +0000 (11:54 +0000)
committerjprocter <Jim Procter>
Thu, 16 Sep 2010 11:54:27 +0000 (11:54 +0000)
src/jalview/ws/jws2/MsaWSThread.java

index 79ffa90..d2b4ce9 100644 (file)
@@ -710,9 +710,17 @@ class MsaWSThread extends AWS2Thread implements WSClientI
           try
           {
             msjob.alignment = server.getResult(msjob.getJobId());
-          } catch (Exception e)
+          } 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);
+            msjob.setjobStatus(JobStatus.FAILED);
+          }
+            catch (Exception e)
           {
             Cache.log.error("Couldn't get Alignment for job.", e);
+            // TODO: Increment count and retry ?
+            msjob.setjobStatus(JobStatus.UNDEFINED);
           }
         }
         finalState.updateJobPanelState(wsInfo, OutputHeader, jobs[j]);
@@ -763,6 +771,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI
     }
     else
     {
+      wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
       wsInfo.setFinishedNoResults();
     }
   }