Breaking the exception cycle

This commit is contained in:
Marcin Grzejszczak
2020-11-09 10:48:39 +01:00
parent 3d76f129d3
commit e9d0c7502e
3 changed files with 42 additions and 18 deletions

View File

@@ -49,6 +49,7 @@ import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.job.builder.FlowBuilder;
@@ -423,7 +424,7 @@ class SpringBatchFlowRunner implements FlowRunner, Closeable {
List<Exception> thrownExceptions = exceptionsThrownBySteps(execution);
return new ExecutionResult(thrownExceptions);
}
catch (JobExecutionException ex) {
catch (JobExecutionException | UnexpectedJobExecutionException ex) {
return ExecutionResult.failure(ex);
}
}