01: /**************************************************************************************
02: * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
03: * http://aspectwerkz.codehaus.org *
04: * ---------------------------------------------------------------------------------- *
05: * The software in this package is published under the terms of the LGPL license *
06: * a copy of which has been included with this distribution in the license.txt file. *
07: **************************************************************************************/package org.codehaus.aspectwerkz.compiler;
08:
09: import java.io.PrintStream;
10: import java.io.PrintWriter;
11:
12: /**
13: * An exception occured during compilation
14: *
15: * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur </a>
16: */
17: public class CompileException extends Exception {
18: private Throwable nested;
19:
20: public CompileException(String msg, Throwable e) {
21: super (msg);
22: nested = e;
23: }
24:
25: public void printStackTrace() {
26: printStackTrace(System.err);
27: }
28:
29: public void printStackTrace(PrintWriter writer) {
30: super .printStackTrace(writer);
31: if (nested != null) {
32: writer.println("nested:");
33: nested.printStackTrace(writer);
34: }
35: }
36:
37: public void printStackTrace(PrintStream out) {
38: super .printStackTrace(out);
39: if (nested != null) {
40: out.println("nested:");
41: nested.printStackTrace(out);
42: }
43: }
44: }
|