Skip to content

Commit

Permalink
Re-throw exceptions when running in single job mode
Browse files Browse the repository at this point in the history
  • Loading branch information
gartens authored and vogti committed Jan 6, 2025
1 parent 1efc42b commit 97db913
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ public void run() {
log.error( "Cannot reset job " + job.toString() + " to status FAILED." );
}
this.failed( job );

if ( singleJobId != null ) {
throw ex;
}
} finally {
// (5.10) De-register the job at the observer
try {
Expand All @@ -311,11 +315,17 @@ public void run() {
} catch ( InterruptedException ex ) {
log.warn( "The chronos agent has been interrupted!", ex );
Thread.currentThread().interrupt();
if ( singleJobId != null ) {
throw new RuntimeException( ex );
}
} catch ( RuntimeException ex ) {
log.error( "Unhandled RuntimeException! Will be re-thrown!", ex );
throw ex;
} catch ( Exception ex ) {
log.error( "Unhandled Exception!", ex );
if ( singleJobId != null ) {
throw new RuntimeException( ex );
}
}

this.agent = null;
Expand Down

0 comments on commit 97db913

Please sign in to comment.