REOPENED - issue BATCH-472: Exceeding the start limit on a step will cause a vague exception type to be thrown.
http://jira.springframework.org/browse/BATCH-472 StartLimitExceededException made public and moved to core package. The constructor changed to simply accept string.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package org.springframework.batch.core;
|
||||
|
||||
/**
|
||||
* Indicates the step's start limit has been exceeded.
|
||||
*/
|
||||
public class StartLimitExceededException extends RuntimeException {
|
||||
|
||||
public StartLimitExceededException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.batch.core.BatchStatus;
|
||||
import org.springframework.batch.core.StartLimitExceededException;
|
||||
import org.springframework.batch.core.UnexpectedJobExecutionException;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobExecutionException;
|
||||
@@ -198,7 +199,8 @@ public class SimpleJob extends AbstractJob {
|
||||
}
|
||||
else {
|
||||
// start max has been exceeded, throw an exception.
|
||||
throw new StartLimitExceededException(step);
|
||||
throw new StartLimitExceededException("Maximum start limit exceeded for step: " + step.getName()
|
||||
+ "StartMax: " + step.getStartLimit());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package org.springframework.batch.core.job;
|
||||
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.UnexpectedJobExecutionException;
|
||||
|
||||
/**
|
||||
* Indicates the step's start limit has been exceeded.
|
||||
*/
|
||||
class StartLimitExceededException extends UnexpectedJobExecutionException {
|
||||
|
||||
public StartLimitExceededException(Step step) {
|
||||
super("Maximum start limit exceeded for step: " + step.getName()
|
||||
+ "StartMax: " + step.getStartLimit());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user