Skip to content

Commit 6c330d6

Browse files
committed
Refine contribution #4668
Before this commit, an assertion was enforcing that when a skip limit is provided, then at least one skippable exception is defined. Since the default value of skip limit was changed to 10 in fd45d32, that assertion is now replaced with a log message at debug level. Related to #4661
1 parent fd45d32 commit 6c330d6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,11 @@ protected SkipPolicy createSkipPolicy() {
555555
map.put(ForceRollbackForWriteSkipException.class, true);
556556
LimitCheckingItemSkipPolicy limitCheckingItemSkipPolicy = new LimitCheckingItemSkipPolicy(skipLimit, map);
557557
if (skipPolicy == null) {
558-
Assert.state(!(skippableExceptionClasses.isEmpty() && skipLimit > 0),
559-
"If a skip limit is provided then skippable exceptions must also be specified");
558+
if (skippableExceptionClasses.isEmpty() && skipLimit > 0) {
559+
logger.debug(String.format(
560+
"A skip limit of %s is set but no skippable exceptions are defined. Consider defining skippable exceptions.",
561+
skipLimit));
562+
}
560563
skipPolicy = limitCheckingItemSkipPolicy;
561564
}
562565
else if (limitCheckingItemSkipPolicy != null) {

0 commit comments

Comments
 (0)