Skip to content

Commit 00575ea

Browse files
committed
Ensure proper response is returned for FrontendError
1 parent 622d0b5 commit 00575ea

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/SessionReadTransaction.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import lombok.Getter;
2222
import lombok.Setter;
23+
import neo4j.org.testkit.backend.FrontendError;
2324
import neo4j.org.testkit.backend.TestkitState;
2425
import neo4j.org.testkit.backend.holder.AsyncTransactionHolder;
2526
import neo4j.org.testkit.backend.holder.RxTransactionHolder;
@@ -119,6 +120,10 @@ private TransactionWork<Void> handle( TestkitState testkitState, SessionHolder s
119120
{
120121
workThrowable = workThrowable.getCause();
121122
}
123+
if ( workThrowable instanceof FrontendError )
124+
{
125+
throw (FrontendError) workThrowable;
126+
}
122127
if ( workThrowable instanceof Neo4jException )
123128
{
124129
throw (Neo4jException) workThrowable;

testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/SessionWriteTransaction.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import lombok.Getter;
2222
import lombok.Setter;
23+
import neo4j.org.testkit.backend.FrontendError;
2324
import neo4j.org.testkit.backend.TestkitState;
2425
import neo4j.org.testkit.backend.holder.AsyncTransactionHolder;
2526
import neo4j.org.testkit.backend.holder.RxTransactionHolder;
@@ -122,6 +123,10 @@ private TransactionWork<Void> handle( TestkitState testkitState, SessionHolder s
122123
{
123124
workThrowable = workThrowable.getCause();
124125
}
126+
if ( workThrowable instanceof FrontendError )
127+
{
128+
throw (FrontendError) workThrowable;
129+
}
125130
if ( workThrowable instanceof Neo4jException )
126131
{
127132
throw (Neo4jException) workThrowable;

0 commit comments

Comments
 (0)