mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-27 17:49:02 +00:00
Support direct matching against exceptions in ExceptionTypeFilter
Prior to this commit, ExceptionTypeFilter only supported matching against an exception type. However, most use cases involve matching against an exception instance. Moreover, every use case within the core Spring Framework uses ExceptionTypeFilter to match against concrete exception instances. This commit therefore introduces an overloaded match(Throwable) method in ExceptionTypeFilter in order to provide support for the most common use cases. See gh-35109 Closes gh-35160
This commit is contained in:
+1
-1
@@ -65,7 +65,7 @@ public record MethodRetrySpec(
|
||||
|
||||
MethodRetryPredicate combinedPredicate() {
|
||||
ExceptionTypeFilter exceptionFilter = new ExceptionTypeFilter(this.includes, this.excludes);
|
||||
return (method, throwable) -> exceptionFilter.match(throwable.getClass()) &&
|
||||
return (method, throwable) -> exceptionFilter.match(throwable) &&
|
||||
this.predicate.shouldRetry(method, throwable);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user