asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject asterixdb git commit: simplify error message
Date Sat, 17 Sep 2016 01:19:57 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 4a4b896d3 -> f5efea594


simplify error message

Provide an exception class only if no message is available and provide only
the simple name of the class, if it is given.

Change-Id: I09c8ef4e3b594801304e2168508b780a443ab6a1
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1181
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/f5efea59
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/f5efea59
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/f5efea59

Branch: refs/heads/master
Commit: f5efea5944bb8b9da435878d03c94eb839458000
Parents: 4a4b896
Author: Till Westmann <tillw@apache.org>
Authored: Fri Sep 16 12:41:25 2016 -0700
Committer: Till Westmann <tillw@apache.org>
Committed: Fri Sep 16 18:19:19 2016 -0700

----------------------------------------------------------------------
 .../asterix/api/http/servlet/QueryServiceServlet.java     | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f5efea59/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
index 3b69dd1..132737b 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
@@ -49,8 +49,8 @@ import org.apache.asterix.lang.common.base.IParser;
 import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.metadata.MetadataManager;
 import org.apache.asterix.translator.IStatementExecutor;
-import org.apache.asterix.translator.IStatementExecutorFactory;
 import org.apache.asterix.translator.IStatementExecutor.Stats;
+import org.apache.asterix.translator.IStatementExecutorFactory;
 import org.apache.commons.io.IOUtils;
 import org.apache.hyracks.algebricks.core.algebra.prettyprint.AlgebricksAppendable;
 import org.apache.hyracks.api.client.IHyracksClientConnection;
@@ -341,8 +341,8 @@ public class QueryServiceServlet extends HttpServlet {
         pw.print("\": [{ \n");
         printField(pw, ErrorField.CODE.str(), "1");
         final String msg = rootCause.getMessage();
-        printField(pw, ErrorField.MSG.str(),
-                JSONUtil.escape(rootCause.getClass().getName() + ": " + (msg != null ? msg
: "")), addStack);
+        printField(pw, ErrorField.MSG.str(), JSONUtil.escape(msg != null ? msg : rootCause.getClass().getSimpleName()),
+                addStack);
         if (addStack) {
             StringWriter sw = new StringWriter();
             PrintWriter stackWriter = new PrintWriter(sw);
@@ -424,8 +424,8 @@ public class QueryServiceServlet extends HttpServlet {
             IParser parser = compilationProvider.getParserFactory().createParser(query);
             List<Statement> aqlStatements = parser.parse();
             MetadataManager.INSTANCE.init();
-            IStatementExecutor translator =
-                    statementExecutorFactory.create(aqlStatements, sessionConfig, compilationProvider);
+            IStatementExecutor translator = statementExecutorFactory.create(aqlStatements,
sessionConfig,
+                    compilationProvider);
             execStart = System.nanoTime();
             translator.compileAndExecute(hcc, hds, QueryTranslator.ResultDelivery.SYNC, stats);
             execEnd = System.nanoTime();


Mime
View raw message