Allow ExitCodeGenerator to be used on Exceptions
Update exit code support to allow the ExitCodeGenerator interface to be placed on an Exception. Any uncaught exception implementing the interface and returning a non `0` status will now trigger a System.exit with the code. Fixes gh-4803
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,6 +42,7 @@ public class SampleBatchApplication {
|
||||
|
||||
@Bean
|
||||
protected Tasklet tasklet() {
|
||||
|
||||
return new Tasklet() {
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution,
|
||||
@@ -49,6 +50,7 @@ public class SampleBatchApplication {
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user