asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhub...@apache.org
Subject incubator-asterixdb git commit: Return ParseExceptions Stacktrace in RESTAPIServlet
Date Thu, 28 Jan 2016 08:04:01 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master 947fc3cb2 -> e05d17cf7


Return ParseExceptions Stacktrace in RESTAPIServlet

Change-Id: Ia22a275aa328c54254c3d0193a472460995f80c5
Reviewed-on: https://asterix-gerrit.ics.uci.edu/599
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>


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

Branch: refs/heads/master
Commit: e05d17cf7262a9a65187ddbbd1d3d7cd946d2ae8
Parents: 947fc3c
Author: Murtadha Hubail <mhubail@uci.edu>
Authored: Wed Jan 27 19:49:05 2016 -0800
Committer: Murtadha Hubail <hubailmor@gmail.com>
Committed: Wed Jan 27 23:59:20 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/asterix/api/http/servlet/RESTAPIServlet.java  | 3 ++-
 .../src/main/java/org/apache/asterix/result/ResultUtils.java      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/e05d17cf/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/RESTAPIServlet.java
----------------------------------------------------------------------
diff --git a/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/RESTAPIServlet.java
b/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/RESTAPIServlet.java
index 0fd782d..95e55f6 100644
--- a/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/RESTAPIServlet.java
+++ b/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/RESTAPIServlet.java
@@ -197,7 +197,8 @@ abstract class RESTAPIServlet extends HttpServlet {
         } catch (AsterixException | TokenMgrError | org.apache.asterix.aqlplus.parser.TokenMgrError
pe) {
             GlobalConfig.ASTERIX_LOGGER.log(Level.SEVERE, pe.getMessage(), pe);
             String errorMessage = ResultUtils.buildParseExceptionMessage(pe, query);
-            JSONObject errorResp = ResultUtils.getErrorResponse(2, errorMessage, "", "");
+            JSONObject errorResp = ResultUtils.getErrorResponse(2, errorMessage, "",
+                    ResultUtils.extractFullStackTrace(pe));
             sessionConfig.out().write(errorResp.toString());
             response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/e05d17cf/asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java
----------------------------------------------------------------------
diff --git a/asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java b/asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java
index 47edc86..2f82f80 100644
--- a/asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java
+++ b/asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java
@@ -305,7 +305,7 @@ public class ResultUtils {
      * @param e
      * @return the string containing the full stack trace of the error.
      */
-    private static String extractFullStackTrace(Throwable e) {
+    public static String extractFullStackTrace(Throwable e) {
         StringWriter stringWriter = new StringWriter();
         PrintWriter printWriter = new PrintWriter(stringWriter);
         e.printStackTrace(printWriter);


Mime
View raw message