Permalink
Browse files

format errors better

  • Loading branch information...
1 parent 5d92db9 commit 8f4945f84cb2b7b8af4996beddb4e1a0296fd71d Robert Newson committed Apr 18, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/main/java/com/github/rnewson/couchdb/lucene/Utils.java
@@ -51,10 +51,12 @@ public static String digest(final String data) {
public static String error(final int code, final Throwable t) {
final StringWriter writer = new StringWriter();
final PrintWriter printWriter = new PrintWriter(writer);
- if (t.getMessage() != null)
+ if (t.getMessage() != null) {
printWriter.append(t.getMessage());
+ printWriter.append("\n");
+ }
t.printStackTrace(printWriter);
- return new JSONObject().element("code", code).element("body", writer.toString()).toString();
+ return new JSONObject().element("code", code).element("body", "<pre>"+ writer + "</pre>").toString();
}
public static String error(final int code, final String txt) {

0 comments on commit 8f4945f

Please sign in to comment.