Skip to content

Commit 6d18d0b

Browse files
refactor: Improve retry predicate by delegating to the driver first.
1 parent 2275a77 commit 6d18d0b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/springframework/data/neo4j/core/support/RetryExceptionPredicate.java

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import org.apiguardian.api.API;
2222
import org.neo4j.driver.exceptions.DiscoveryException;
23+
import org.neo4j.driver.exceptions.RetryableException;
2324
import org.neo4j.driver.exceptions.ServiceUnavailableException;
2425
import org.neo4j.driver.exceptions.SessionExpiredException;
2526
import org.neo4j.driver.exceptions.TransientException;
@@ -43,6 +44,10 @@ public final class RetryExceptionPredicate implements Predicate<Throwable> {
4344
@Override
4445
public boolean test(Throwable throwable) {
4546

47+
if (throwable instanceof RetryableException) {
48+
return true;
49+
}
50+
4651
if (throwable instanceof IllegalStateException) {
4752
String msg = throwable.getMessage();
4853
return msg != null && RETRYABLE_ILLEGAL_STATE_MESSAGES.contains(msg);

0 commit comments

Comments
 (0)