Skip to content

Commit 2538c96

Browse files
committed
Updated error code according to server response
1 parent f6f6d5d commit 2538c96

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

driver/src/main/java/org/neo4j/driver/internal/ClusteredNetworkSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public StatementResult run( Statement statement )
5353
}
5454
catch ( ClientException e )
5555
{
56-
if ( e.code().equals( "Neo.ClientError.General.ForbiddenOnFollower" ) )
56+
if ( e.code().equals( "Neo.ClientError.Cluster.NotALeader" ) )
5757
{
5858
onError.onWriteFailure( connection.address() );
5959
throw new SessionExpiredException(

driver/src/main/java/org/neo4j/driver/internal/ClusteredStatementResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,6 @@ private SessionExpiredException failedWrite()
256256

257257
private boolean isFailedToWrite( ClientException e )
258258
{
259-
return e.code().equals( "Neo.ClientError.General.ForbiddenOnFollower" );
259+
return e.code().equals( "Neo.ClientError.Cluster.NotALeader" );
260260
}
261261
}

driver/src/test/resources/not_able_to_write_server.script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
C: RUN "CREATE ()" {}
77
C: PULL_ALL
8-
S: FAILURE {"code": "Neo.ClientError.General.ForbiddenOnFollower", "message": "blabla"}
8+
S: FAILURE {"code": "Neo.ClientError.Cluster.NotALeader", "message": "blabla"}
99
S: IGNORED
1010
C: ACK_FAILURE
1111
S: SUCCESS {}

0 commit comments

Comments
 (0)