package bolts; import java.io.PrintStream; import java.io.PrintWriter; import java.util.List; public class AggregateException extends Exception { private static final long serialVersionUID = 1; private List innerThrowables; @Override // java.lang.Throwable public void printStackTrace(PrintStream printStream) { super.printStackTrace(printStream); int i = -1; for (Throwable th : this.innerThrowables) { printStream.append("\n"); printStream.append(" Inner throwable #"); i++; printStream.append((CharSequence) Integer.toString(i)); printStream.append(": "); th.printStackTrace(printStream); printStream.append("\n"); } } @Override // java.lang.Throwable public void printStackTrace(PrintWriter printWriter) { super.printStackTrace(printWriter); int i = -1; for (Throwable th : this.innerThrowables) { printWriter.append("\n"); printWriter.append(" Inner throwable #"); i++; printWriter.append((CharSequence) Integer.toString(i)); printWriter.append(": "); th.printStackTrace(printWriter); printWriter.append("\n"); } } }