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 Tue, 25 Nov 2014 02:34:16 GMT
Repository: tajo
Updated Branches:
  refs/heads/2563e1953d72bc41168b0a8710cbca5fcabb09a0 [created] 2563e1953


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

Closes #238


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

Branch: refs/heads/2563e1953d72bc41168b0a8710cbca5fcabb09a0
Commit: 2563e1953d72bc41168b0a8710cbca5fcabb09a0
Parents: e9d8566
Author: JaeHwa Jung <blrunner@apache.org>
Authored: Tue Nov 25 11:33:36 2014 +0900
Committer: JaeHwa Jung <blrunner@apache.org>
Committed: Tue Nov 25 11:33:36 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/2563e195/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 1fb3ece..b8fc9bb 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-1195: Remove unused CachedDNSResolver Class. (DaeMyung Kang via jaehwa)

http://git-wip-us.apache.org/repos/asf/tajo/blob/2563e195/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/2563e195/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