X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstemmaweb%2FController%2FStemweb.pm;h=42126ece00d38315f6166cf1100ce8dfa90ad015;hb=509e94bc8086be4f2e2029d6c707c7dc541a762a;hp=ad90815eed40d924246962072a8e1ed64c52d853;hpb=b7c3508f96338cf49f11f545119f822124875860;p=scpubgit%2Fstemmaweb.git diff --git a/lib/stemmaweb/Controller/Stemweb.pm b/lib/stemmaweb/Controller/Stemweb.pm index ad90815..42126ec 100644 --- a/lib/stemmaweb/Controller/Stemweb.pm +++ b/lib/stemmaweb/Controller/Stemweb.pm @@ -214,11 +214,13 @@ sub _process_stemweb_result { } $c->stash->{'result'} = { status => 'notfound' }; } - } elsif( $answer->{status} == -1 ) { + } elsif( $answer->{status} == 1 ) { $c->stash->{'result'} = { 'status' => 'running' }; } else { - return _json_error( $c, 500, - "Stemweb failure not handled: " . $answer->{result} ); + # Failure. Clear the job ID so that the user can try again. + $tradition->_clear_stemweb_jobid; + $m->save( $tradition ); + $c->stash->{'result'} = { 'status' => 'failed', 'message' => $answer->{result} }; } $c->forward('View::JSON'); }