use of org.neo4j.exceptions.Neo4jException 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;
}
use of org.neo4j.exceptions.Neo4jException in project neo4j by neo4j.
the class Invocation method executeStatements.
private void executeStatements() {
try {
while (outputError == null) {
memoryPool.reserveHeap(Statement.SHALLOW_SIZE);
try {
Statement statement = readStatement();
if (statement == null) {
return;
}
executeStatement(statement);
} finally {
memoryPool.releaseHeap(Statement.SHALLOW_SIZE);
}
}
} catch (InputFormatException e) {
handleNeo4jError(Status.Request.InvalidFormat, e);
} catch (KernelException | Neo4jException | AuthorizationViolationException | WriteOperationsNotAllowedException e) {
handleNeo4jError(e.status(), e);
} catch (DeadlockDetectedException e) {
handleNeo4jError(Status.Transaction.DeadlockDetected, e);
} catch (Exception e) {
Throwable cause = e.getCause();
if (cause instanceof Status.HasStatus) {
handleNeo4jError(((Status.HasStatus) cause).status(), cause);
} else {
handleNeo4jError(Status.Statement.ExecutionFailed, e);
}
}
}
Aggregations