Skip to content

Commit

Permalink
Refine contribution #4668
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fmbenhassine committed Nov 20, 2024
1 parent fd45d32 commit 6c330d6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,11 @@ protected SkipPolicy createSkipPolicy() {
map.put(ForceRollbackForWriteSkipException.class, true);
LimitCheckingItemSkipPolicy limitCheckingItemSkipPolicy = new LimitCheckingItemSkipPolicy(skipLimit, map);
if (skipPolicy == null) {
Assert.state(!(skippableExceptionClasses.isEmpty() && skipLimit > 0),
"If a skip limit is provided then skippable exceptions must also be specified");
if (skippableExceptionClasses.isEmpty() && skipLimit > 0) {
logger.debug(String.format(
"A skip limit of %s is set but no skippable exceptions are defined. Consider defining skippable exceptions.",
skipLimit));
}
skipPolicy = limitCheckingItemSkipPolicy;
}
else if (limitCheckingItemSkipPolicy != null) {
Expand Down

0 comments on commit 6c330d6

Please sign in to comment.