KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > aspectwerkz > compiler > CompileException


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.aspectwerkz.compiler;
5
6 import java.io.PrintStream JavaDoc;
7 import java.io.PrintWriter JavaDoc;
8
9 /**
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 JavaDoc {
15   private Throwable JavaDoc nested;
16
17   public CompileException(String JavaDoc msg, Throwable JavaDoc e) {
18     super(msg);
19     nested = e;
20   }
21
22   public void printStackTrace() {
23     printStackTrace(System.err);
24   }
25
26   public void printStackTrace(PrintWriter JavaDoc 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 JavaDoc out) {
35     super.printStackTrace(out);
36     if (nested != null) {
37       out.println("nested:");
38       nested.printStackTrace(out);
39     }
40   }
41 }
Popular Tags