File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
main/java/org/neo4j/driver/internal/retry
test/java/org/neo4j/driver/internal/retry Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 3030import java .util .function .Supplier ;
3131import org .neo4j .driver .Logger ;
3232import org .neo4j .driver .Logging ;
33- import org .neo4j .driver .exceptions .ClientException ;
3433import org .neo4j .driver .exceptions .Neo4jException ;
3534import org .neo4j .driver .exceptions .RetryableException ;
36- import org .neo4j .driver .exceptions .SecurityRetryableException ;
35+ import org .neo4j .driver .exceptions .TransactionTerminatedException ;
3736import org .neo4j .driver .internal .util .Futures ;
3837import org .reactivestreams .Publisher ;
3938import reactor .core .publisher .Flux ;
@@ -161,10 +160,7 @@ protected boolean canRetryOn(Throwable error) {
161160 * @return the possible cause or the original error
162161 */
163162 private static Throwable extractPossibleTerminationCause (Throwable error ) {
164- // Having a dedicated "TerminatedException" inheriting from ClientException might be a good idea.
165- if (!(error instanceof SecurityRetryableException )
166- && error instanceof ClientException
167- && error .getCause () != null ) {
163+ if (error instanceof TransactionTerminatedException && error .getCause () != null ) {
168164 return error .getCause ();
169165 }
170166 return error ;
Original file line number Diff line number Diff line change 6868import org .neo4j .driver .exceptions .ConnectionReadTimeoutException ;
6969import org .neo4j .driver .exceptions .ServiceUnavailableException ;
7070import org .neo4j .driver .exceptions .SessionExpiredException ;
71+ import org .neo4j .driver .exceptions .TransactionTerminatedException ;
7172import org .neo4j .driver .exceptions .TransientException ;
7273import org .neo4j .driver .internal .util .ImmediateSchedulingEventExecutor ;
7374import org .reactivestreams .Publisher ;
@@ -1300,7 +1301,7 @@ private static ServiceUnavailableException serviceUnavailable() {
13001301 }
13011302
13021303 private static RuntimeException clientExceptionWithValidTerminationCause () {
1303- return new ClientException ("¯\\ _(ツ)_/¯" , serviceUnavailable ());
1304+ return new TransactionTerminatedException ("¯\\ _(ツ)_/¯" , serviceUnavailable ());
13041305 }
13051306
13061307 private static RuntimeException randomClientException () {
You can’t perform that action at this time.
0 commit comments