Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -63,6 +64,8 @@
@Produces({MediaType.TEXT_PLAIN})
public class CypherUtilService extends BaseResource {

private static final Logger logger = Logger.getLogger(CypherUtilService.class.getName());

final private CypherUtil cypherUtil;
final private GraphDatabaseService graphDb;
final private CurieUtil curieUtil;
Expand Down Expand Up @@ -131,6 +134,10 @@ public Response execute(
} else {
return Response.ok(cypherUtil.execute(replacedStartCurie).resultAsString()).cacheControl(null).build();
}
} catch (QueryExecutionException e) {
String errorMsg = "QueryExecutionException: " + e.getMessage();
logger.warning(errorMsg);
return Response.status(400).entity(errorMsg).build();
} catch (TransactionTerminatedException e) {
return Response.ok("The query execution exceeds dbms.transaction.timeout configuration. " +
"Consider using the neo4j shell instead of this service.").build();
Expand Down