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 30
30
import java .util .function .Supplier ;
31
31
import org .neo4j .driver .Logger ;
32
32
import org .neo4j .driver .Logging ;
33
- import org .neo4j .driver .exceptions .ClientException ;
34
33
import org .neo4j .driver .exceptions .Neo4jException ;
35
34
import org .neo4j .driver .exceptions .RetryableException ;
36
- import org .neo4j .driver .exceptions .SecurityRetryableException ;
35
+ import org .neo4j .driver .exceptions .TransactionTerminatedException ;
37
36
import org .neo4j .driver .internal .util .Futures ;
38
37
import org .reactivestreams .Publisher ;
39
38
import reactor .core .publisher .Flux ;
@@ -161,10 +160,7 @@ protected boolean canRetryOn(Throwable error) {
161
160
* @return the possible cause or the original error
162
161
*/
163
162
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 ) {
168
164
return error .getCause ();
169
165
}
170
166
return error ;
Original file line number Diff line number Diff line change 68
68
import org .neo4j .driver .exceptions .ConnectionReadTimeoutException ;
69
69
import org .neo4j .driver .exceptions .ServiceUnavailableException ;
70
70
import org .neo4j .driver .exceptions .SessionExpiredException ;
71
+ import org .neo4j .driver .exceptions .TransactionTerminatedException ;
71
72
import org .neo4j .driver .exceptions .TransientException ;
72
73
import org .neo4j .driver .internal .util .ImmediateSchedulingEventExecutor ;
73
74
import org .reactivestreams .Publisher ;
@@ -1300,7 +1301,7 @@ private static ServiceUnavailableException serviceUnavailable() {
1300
1301
}
1301
1302
1302
1303
private static RuntimeException clientExceptionWithValidTerminationCause () {
1303
- return new ClientException ("¯\\ _(ツ)_/¯" , serviceUnavailable ());
1304
+ return new TransactionTerminatedException ("¯\\ _(ツ)_/¯" , serviceUnavailable ());
1304
1305
}
1305
1306
1306
1307
private static RuntimeException randomClientException () {
You can’t perform that action at this time.
0 commit comments