01: /*
02: * Copyright 2005 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */
13: package com.sun.portal.wsrp.wssso.common;
14:
15: import java.io.PrintStream;
16: import java.io.PrintWriter;
17:
18: public class WSSSOConfigException extends Exception {
19:
20: protected Throwable wrapped = null;
21:
22: /**
23: * Constructs a new exception with the specified message, indicating an
24: * error in the provider as happened.<br><br>
25: *
26: * @param msg The descriptive message.
27: */
28: public WSSSOConfigException(String msg) {
29: super (msg);
30: }
31:
32: /**
33: * Constructs a new exception with the specified message, and the original
34: * <code>exception</code> or <code>error</code>, indicating an error in the
35: * WSRP as happened.<br><br>
36: *
37: * @param msg The descriptive message.
38: * @param e The original <code>exception</code> or <code>error</code>.
39: */
40: public WSSSOConfigException(String msg, Throwable t) {
41: super (msg);
42: wrapped = t;
43: }
44:
45: public WSSSOConfigException(Throwable t) {
46: super ();
47: wrapped = t;
48: }
49:
50: public Throwable getWrapped() {
51: return wrapped;
52: }
53:
54: public String toString() {
55: StringBuffer b = new StringBuffer();
56:
57: b.append(super .toString());
58: if (getWrapped() != null) {
59: b.append(wrapped.toString());
60: }
61:
62: return b.toString();
63: }
64:
65: public void printStackTrace() {
66: super .printStackTrace();
67: if (getWrapped() != null) {
68: wrapped.printStackTrace();
69: }
70: }
71:
72: public void printStackTrace(PrintStream s) {
73: super .printStackTrace(s);
74: if (getWrapped() != null) {
75: wrapped.printStackTrace(s);
76: }
77: }
78:
79: public void printStackTrace(PrintWriter s) {
80: super.printStackTrace(s);
81: if (getWrapped() != null) {
82: wrapped.printStackTrace(s);
83: }
84: }
85: }
|