01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.providers.userinfo.tag;
07:
08: import java.io.PrintStream;
09: import java.io.PrintWriter;
10: import com.sun.portal.desktop.util.WrapperException;
11:
12: public class TagWrapperException extends TagException implements
13: WrapperException {
14:
15: Exception wrapped = null;
16:
17: /**
18: * Create a new wrapper exception.
19: *
20: * @param e The exception to be wrapper.
21: */
22: public TagWrapperException(String msg, Exception e) {
23: super (msg);
24:
25: setWrappedException(e);
26: }
27:
28: private void setWrappedException(Exception e) {
29: wrapped = e;
30: }
31:
32: /**
33: * Access the wrapped exception.
34: *
35: * @return The wrapped exception.
36: */
37:
38: public Exception getWrappedException() {
39: return wrapped;
40: }
41:
42: public String toString() {
43: return super .toString() + "\n"
44: + getWrappedException().toString();
45: }
46:
47: public void printStackTrace() {
48: super .printStackTrace();
49: getWrappedException().printStackTrace();
50: }
51:
52: public void printStackTrace(PrintWriter s) {
53: super .printStackTrace(s);
54: getWrappedException().printStackTrace(s);
55: }
56:
57: public void printStackTrace(PrintStream s) {
58: super.printStackTrace(s);
59: getWrappedException().printStackTrace(s);
60: }
61: }
|