falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject [3/3] falcon git commit: FALCON-1381 The webservice response of Falcon includes a stack trace in case of errors. Contributed by Narayan Periwal.
Date Thu, 10 Sep 2015 09:45:38 GMT
FALCON-1381 The webservice response of Falcon includes a stack trace in case of errors. Contributed
by Narayan Periwal.


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

Branch: refs/heads/master
Commit: 407bb8595ec44c9f9daf992006c5d1d7d4700289
Parents: e5a1d59
Author: Ajay Yadava <ajaynsit@gmail.com>
Authored: Thu Sep 10 14:30:55 2015 +0530
Committer: Ajay Yadava <ajaynsit@gmail.com>
Committed: Thu Sep 10 14:30:55 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                                   | 2 ++
 prism/src/main/java/org/apache/falcon/FalconWebException.java | 6 +-----
 2 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/407bb859/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2210d3b..29e16d4 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -20,6 +20,8 @@ Trunk (Unreleased)
   OPTIMIZATIONS
 
   BUG FIXES
+    FALCON-1381 The webservice response of Falcon includes a stack trace in case of errors(Narayan
Periwal via Ajay Yadava)
+
     FALCON-1438 Falcon RestAPI - In case of error falcon responds with FalconWebException::null(Balu
Vellanki via Ajay Yadava).
 
     FALCON-1415 Hive DR process fail if there are no events available from source table(Peeyush
Bishnoi via Ajay Yadava)

http://git-wip-us.apache.org/repos/asf/falcon/blob/407bb859/prism/src/main/java/org/apache/falcon/FalconWebException.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/FalconWebException.java b/prism/src/main/java/org/apache/falcon/FalconWebException.java
index 7f8d0cd..7324997 100644
--- a/prism/src/main/java/org/apache/falcon/FalconWebException.java
+++ b/prism/src/main/java/org/apache/falcon/FalconWebException.java
@@ -30,8 +30,6 @@ import org.slf4j.LoggerFactory;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
-import java.io.PrintWriter;
-import java.io.StringWriter;
 
 /**
  * Exception for REST APIs.
@@ -103,9 +101,7 @@ public class FalconWebException extends WebApplicationException {
     }
 
     private static String getMessage(Throwable e) {
-        StringWriter errors = new StringWriter();
-        e.printStackTrace(new PrintWriter(errors));
-        return errors.toString();
+        return e.getCause()==null? e.getMessage():e.getMessage() + "\nCausedBy: " + e.getCause().getMessage();
     }
 
     public FalconWebException(Throwable e, Response response) {


Mime
View raw message