From 0981f3329c5e79bd504b460d214097dede42f2da Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Thu, 15 Sep 2016 17:31:40 +0300 Subject: [PATCH] More details on exception in QueryProcessorImpl --- .../meridor/perspective/sql/impl/QueryProcessorImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/QueryProcessorImpl.java b/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/QueryProcessorImpl.java index 8d8b7bf3..6ce3515c 100644 --- a/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/QueryProcessorImpl.java +++ b/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/QueryProcessorImpl.java @@ -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; @@ -24,6 +26,8 @@ @Component public class QueryProcessorImpl implements QueryProcessor { + private static final Logger LOG = LoggerFactory.getLogger(QueryProcessorImpl.class); + @Autowired private ApplicationContext applicationContext; @@ -63,8 +67,10 @@ private List 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)); }