Skip to content

Commit

Permalink
More details on exception in QueryProcessorImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
vania-pooh committed Sep 15, 2016
1 parent a6a0d3c commit 0981f33
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.meridor.perspective.sql.*;
import org.meridor.perspective.sql.impl.parser.QueryType;
import org.meridor.perspective.sql.impl.task.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
Expand All @@ -24,6 +26,8 @@
@Component
public class QueryProcessorImpl implements QueryProcessor {

private static final Logger LOG = LoggerFactory.getLogger(QueryProcessorImpl.class);

@Autowired
private ApplicationContext applicationContext;

Expand Down Expand Up @@ -63,8 +67,10 @@ private List<QueryResult> processQuery(Query query) {
createExplainExecutionResult(tasks);
queryResults.add(getQueryResult(SUCCESS, executionResult.getCount(), executionResult.getData(), ""));
} catch (SQLSyntaxErrorException e) {
LOG.debug("Marking query as having syntax error", e);
queryResults.add(getQueryResult(SYNTAX_ERROR, 0, empty(), e.getMessage()));
} catch (SQLException e) {
LOG.debug("Marking query as having evaluation error", e);
String message = e.getCause() != null ? e.getCause().getMessage() : e.getMessage();
queryResults.add(getQueryResult(EVALUATION_ERROR, 0, empty(), message));
}
Expand Down

0 comments on commit 0981f33

Please sign in to comment.