Skip to content

Commit 76298df

Browse files
committed
Fix missing exception conversion in TestKit backend
Error was introduced with neo4j#1154
1 parent d133329 commit 76298df

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 4 additions & 2 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;
@@ -123,10 +124,11 @@ private TransactionWork<Void> handle( TestkitState testkitState, SessionHolder s
123124
{
124125
throw (Neo4jException) workThrowable;
125126
}
126-
else
127+
if ( workThrowable instanceof FrontendError )
127128
{
128-
throw new RuntimeException( "Unexpected exception occurred in transaction work function", workThrowable );
129+
throw (FrontendError) workThrowable;
129130
}
131+
throw new RuntimeException( "Unexpected exception occurred in transaction work function", workThrowable );
130132
}
131133
};
132134
}

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

Lines changed: 4 additions & 2 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;
@@ -126,10 +127,11 @@ private TransactionWork<Void> handle( TestkitState testkitState, SessionHolder s
126127
{
127128
throw (Neo4jException) workThrowable;
128129
}
129-
else
130+
if ( workThrowable instanceof FrontendError )
130131
{
131-
throw new RuntimeException( "Unexpected exception occurred in transaction work function", workThrowable );
132+
throw (FrontendError) workThrowable;
132133
}
134+
throw new RuntimeException( "Unexpected exception occurred in transaction work function", workThrowable );
133135
}
134136
};
135137
}

0 commit comments

Comments
 (0)