tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blrun...@apache.org
Subject tajo git commit: TAJO-1165: Needs to show error messages on query_executor.jsp. (Jihun Kang via jaehwa)
Date Thu, 27 Nov 2014 13:36:43 GMT
Repository: tajo
Updated Branches:
  refs/heads/master f3291621c -> 4637f7fd1


TAJO-1165: Needs to show error messages on query_executor.jsp. (Jihun Kang via jaehwa)


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

Branch: refs/heads/master
Commit: 4637f7fd126c46f0e6a4bcdf2d816511b690552b
Parents: f329162
Author: JaeHwa Jung <blrunner@apache.org>
Authored: Thu Nov 27 22:34:53 2014 +0900
Committer: JaeHwa Jung <blrunner@apache.org>
Committed: Thu Nov 27 22:34:53 2014 +0900

----------------------------------------------------------------------
 CHANGES                                             |  2 ++
 .../apache/tajo/webapp/QueryExecutorServlet.java    | 16 ++++++++++++++++
 .../main/resources/webapps/admin/query_executor.jsp |  4 ++--
 3 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/4637f7fd/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9b15898..8bf0c1c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -13,6 +13,8 @@ Release 0.9.1 - unreleased
 
   IMPROVEMENT
 
+    TAJO-1165: Needs to show error messages on query_executor.jsp. (Jihun Kang via jaehwa)
+
     TAJO-1204: Remove unused ServerName class. (DaeMyung Kang via jaehwa)
 
     TAJO-1053: ADD PARTITIONS for HCatalogStore. (jaehwa)

http://git-wip-us.apache.org/repos/asf/tajo/blob/4637f7fd/tajo-core/src/main/java/org/apache/tajo/webapp/QueryExecutorServlet.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/webapp/QueryExecutorServlet.java b/tajo-core/src/main/java/org/apache/tajo/webapp/QueryExecutorServlet.java
index 0075b04..da25fe6 100644
--- a/tajo-core/src/main/java/org/apache/tajo/webapp/QueryExecutorServlet.java
+++ b/tajo-core/src/main/java/org/apache/tajo/webapp/QueryExecutorServlet.java
@@ -316,6 +316,22 @@ public class QueryExecutorServlet extends HttpServlet {
 
             progress.set(100);
           }
+        } else if (response.getResultCode() == ClientProtos.ResultCode.ERROR) {
+          if (response.hasErrorMessage()) {
+            StringBuffer errorMessage = new StringBuffer(response.getErrorMessage());
+            String modifiedMessage;
+
+            if (errorMessage.length() > 200) {
+              modifiedMessage = errorMessage.substring(0, 200);
+            } else {
+              modifiedMessage = errorMessage.toString();
+            }
+            
+            String lineSeparator = System.getProperty("line.separator");
+            modifiedMessage = modifiedMessage.replaceAll(lineSeparator, "<br/>");
+
+            error = new Exception(modifiedMessage);
+          }
         }
       } catch (Exception e) {
         LOG.error(e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/tajo/blob/4637f7fd/tajo-core/src/main/resources/webapps/admin/query_executor.jsp
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/resources/webapps/admin/query_executor.jsp b/tajo-core/src/main/resources/webapps/admin/query_executor.jsp
index bbd1820..9ff6625 100644
--- a/tajo-core/src/main/resources/webapps/admin/query_executor.jsp
+++ b/tajo-core/src/main/resources/webapps/admin/query_executor.jsp
@@ -102,7 +102,7 @@ function runQuery() {
     var resultJson = $.parseJSON(msg);
     if(resultJson.success == "false") {
       clearTimer();
-      alert(resultJson.errorMessage);
+      alert("query execution failed.");
       return;
     }
     queryRunnerId = resultJson.queryRunnerId;
@@ -116,7 +116,7 @@ function runQuery() {
         var resultJson = $.parseJSON(msg);
         if(resultJson.success == "false") {
           clearTimer();
-          alert(resultJson.errorMessage);
+          alert("query execution failed.");
           $("#queryStatus").html(getQueryStatusHtml(resultJson));
           return;
         }


Mime
View raw message