Merge simon's changes to PrettyPrinter which include cause in stacktrace

This commit is contained in:
Mumfrey committed 2016-11-15 11:44:08 +00:00
commit 38e8e5a951
1 file changed
+6 -2
@@ -683,8 +683,12 @@ public class PrettyPrinter {
* @return fluent interface
*/
public PrettyPrinter add(Throwable th, int indent) {
this.add("%s: %s", th.getClass().getName(), th.getMessage());
return this.add(th.getStackTrace(), indent);
while (th != null) {
this.add("%s: %s", th.getClass().getName(), th.getMessage());
this.add(th.getStackTrace(), indent);
th = th.getCause();
}
return this;
}
/**