use of org.neo4j.fabric.executor.FabricException in project neo4j by neo4j.
the class TestFabricTransaction method execute.
@Override
public Result execute(String query, Map<String, Object> parameters) throws QueryExecutionException {
var ctx = new TestFabricTransactionalContext(kernelInternalTransaction);
var params = ValueUtils.asParameterMapValue(parameters);
var result = new ResultSubscriber(ctx, ctx.valueMapper());
try {
BoltQueryExecution boltQueryExecution = fabricTransaction.executeQuery(query, params, false, result);
result.init(boltQueryExecution.getQueryExecution());
} catch (FabricException e) {
if (e.getCause() instanceof RuntimeException) {
throw (RuntimeException) e.getCause();
} else {
throw new QueryExecutionException(e.getMessage(), e, e.status().code().serialize());
}
} catch (QueryExecutionKernelException | Neo4jException e) {
throw new QueryExecutionException(e.getMessage(), e, e.status().code().serialize());
}
return result;
}
Aggregations