KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > jwebunit > util > ExceptionWrapper


1 /********************************************************************************
2  * Copyright (c) 2001, ThoughtWorks, Inc.
3  * Distributed open-source, see full license under licenses/jwebunit_license.txt
4  **********************************/

5 package net.sourceforge.jwebunit.util;
6
7 import java.io.PrintStream JavaDoc;
8 import java.io.PrintWriter JavaDoc;
9
10 /**
11  * User: djoiner
12  * Date: Nov 21, 2002
13  * Time: 2:05:07 PM
14  */

15
16 public class ExceptionWrapper extends RuntimeException JavaDoc {
17     private Throwable JavaDoc thrown;
18
19     public ExceptionWrapper(Throwable JavaDoc t) {
20         thrown = t;
21     }
22
23     public Throwable JavaDoc fillInStackTrace() {
24         return thrown == null? null : thrown.fillInStackTrace();
25     }
26
27     public String JavaDoc getMessage() {
28         return thrown.getMessage();
29     }
30
31     public String JavaDoc getLocalizedMessage() {
32         return thrown.getLocalizedMessage();
33     }
34
35     public String JavaDoc toString() {
36         return thrown.toString();
37     }
38
39     public void printStackTrace() {
40         thrown.printStackTrace();
41     }
42
43     public void printStackTrace(PrintStream JavaDoc s) {
44         thrown.printStackTrace(s);
45     }
46
47     public void printStackTrace(PrintWriter JavaDoc s) {
48         thrown.printStackTrace(s);
49     }
50 }
51
Popular Tags