incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Forgot to add the throwable wrapper.
Date Sun, 07 Oct 2012 14:24:17 GMT
Updated Branches:
  refs/heads/new-api-prototype 06df22a65 -> 0ec49da9c


Forgot to add the throwable wrapper.


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

Branch: refs/heads/new-api-prototype
Commit: 0ec49da9cb723edf5885309b723f967525ec05b9
Parents: 06df22a
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Sun Oct 7 10:23:51 2012 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Sun Oct 7 10:23:51 2012 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/blur/core/Util.java   |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/0ec49da9/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/Util.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/Util.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/Util.java
index d62bcdd..e24412d 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/Util.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/Util.java
@@ -16,6 +16,8 @@ package org.apache.blur.core;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.nio.ByteBuffer;
 import java.util.List;
 
@@ -89,8 +91,12 @@ public class Util {
   }
 
   public static BlurException wrapThrowable(Throwable t) {
-    // TODO Auto-generated method stub
-    return null;
+    StringWriter writer = new StringWriter();
+    PrintWriter printWriter = new PrintWriter(writer);
+    t.printStackTrace(printWriter);
+    printWriter.close();
+    String stackTraceStr = writer.toString();
+    return new BlurException(t.getMessage(), stackTraceStr);
   }
 
 }


Mime
View raw message