Skip to content

Commit 97db913

Browse files
gartensvogti
authored andcommitted
Re-throw exceptions when running in single job mode
1 parent 1efc42b commit 97db913

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/main/java/ch/unibas/dmi/dbis/chronos/agent/AbstractChronosAgent.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ public void run() {
286286
log.error( "Cannot reset job " + job.toString() + " to status FAILED." );
287287
}
288288
this.failed( job );
289+
290+
if ( singleJobId != null ) {
291+
throw ex;
292+
}
289293
} finally {
290294
// (5.10) De-register the job at the observer
291295
try {
@@ -311,11 +315,17 @@ public void run() {
311315
} catch ( InterruptedException ex ) {
312316
log.warn( "The chronos agent has been interrupted!", ex );
313317
Thread.currentThread().interrupt();
318+
if ( singleJobId != null ) {
319+
throw new RuntimeException( ex );
320+
}
314321
} catch ( RuntimeException ex ) {
315322
log.error( "Unhandled RuntimeException! Will be re-thrown!", ex );
316323
throw ex;
317324
} catch ( Exception ex ) {
318325
log.error( "Unhandled Exception!", ex );
326+
if ( singleJobId != null ) {
327+
throw new RuntimeException( ex );
328+
}
319329
}
320330

321331
this.agent = null;

0 commit comments

Comments
 (0)