Till Westmann has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1181

Change subject: simplify error message
......................................................................

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
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/81/1181/1

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.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 @@
         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 @@
             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();

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1181
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09c8ef4e3b594801304e2168508b780a443ab6a1
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <ti...@apache.org>

Reply via email to