01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.aspectwerkz.compiler;
05:
06: import java.io.PrintStream;
07: import java.io.PrintWriter;
08:
09: /**
10: * An exception occured during compilation
11: *
12: * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur </a>
13: */
14: public class CompileException extends Exception {
15: private Throwable nested;
16:
17: public CompileException(String msg, Throwable e) {
18: super (msg);
19: nested = e;
20: }
21:
22: public void printStackTrace() {
23: printStackTrace(System.err);
24: }
25:
26: public void printStackTrace(PrintWriter writer) {
27: super .printStackTrace(writer);
28: if (nested != null) {
29: writer.println("nested:");
30: nested.printStackTrace(writer);
31: }
32: }
33:
34: public void printStackTrace(PrintStream out) {
35: super .printStackTrace(out);
36: if (nested != null) {
37: out.println("nested:");
38: nested.printStackTrace(out);
39: }
40: }
41: }
|