KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > aspectwerkz > compiler > CompileException


1 /**************************************************************************************
2  * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
3  * http://aspectwerkz.codehaus.org *
4  * ---------------------------------------------------------------------------------- *
5  * The software in this package is published under the terms of the LGPL license *
6  * a copy of which has been included with this distribution in the license.txt file. *
7  **************************************************************************************/

8 package org.codehaus.aspectwerkz.compiler;
9
10 import java.io.PrintStream JavaDoc;
11 import java.io.PrintWriter JavaDoc;
12
13 /**
14  * An exception occured during compilation
15  *
16  * @author <a HREF="mailto:alex@gnilux.com">Alexandre Vasseur </a>
17  */

18 public class CompileException extends Exception JavaDoc {
19     private Throwable JavaDoc nested;
20
21     public CompileException(String JavaDoc msg, Throwable JavaDoc e) {
22         super(msg);
23         nested = e;
24     }
25
26     public void printStackTrace() {
27         printStackTrace(System.err);
28     }
29
30     public void printStackTrace(PrintWriter JavaDoc writer) {
31         super.printStackTrace(writer);
32         if (nested != null) {
33             writer.println("nested:");
34             nested.printStackTrace(writer);
35         }
36     }
37
38     public void printStackTrace(PrintStream JavaDoc out) {
39         super.printStackTrace(out);
40         if (nested != null) {
41             out.println("nested:");
42             nested.printStackTrace(out);
43         }
44     }
45 }
Popular Tags