use of ai.grakn.exception.GraqlQueryException in project grakn by graknlabs.
the class RemoteGraknTxTest method whenAnErrorOccurs_AllFutureActionsThrow.
@Test
public void whenAnErrorOccurs_AllFutureActionsThrow() {
Query<?> query = match(var("x")).get();
TxRequest execQueryRequest = GrpcUtil.execQueryRequest(query);
throwOn(execQueryRequest, ErrorType.GRAQL_QUERY_EXCEPTION, "well something went wrong");
try (GraknTx tx = RemoteGraknTx.create(session, GrpcUtil.openRequest(KEYSPACE, GraknTxType.WRITE))) {
try {
tx.graql().match(var("x")).get().execute();
} catch (GraqlQueryException e) {
// Ignore
}
exception.expect(GraknTxOperationException.class);
exception.expectMessage(GraknTxOperationException.transactionClosed(null, "The gRPC connection closed").getMessage());
tx.admin().getMetaConcept();
}
}
Aggregations