01: /*
02: * Copyright 2002 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:
14: package com.sun.portal.portletcontainercommon.descriptor;
15:
16: import java.io.PrintStream;
17: import java.io.PrintWriter;
18:
19: public class DeploymentDescriptorException extends Exception {
20:
21: protected Throwable wrapped = null;
22:
23: /**
24: * Constructs a new exception with the specified message, indicating an
25: * error in the provider as happened.<br><br>
26: *
27: * @param msg The descriptive message.
28: */
29: public DeploymentDescriptorException(String msg) {
30: super (msg);
31: }
32:
33: /**
34: * Constructs a new exception with the specified message, and the original
35: * <code>exception</code> or <code>error</code>, indicating an error in the
36: * deployment descriptor as happened.<br><br>
37: *
38: * @param msg The descriptive message.
39: * @param e The original <code>exception</code> or <code>error</code>.
40: */
41: public DeploymentDescriptorException(String msg, Throwable e) {
42: super (msg);
43: wrapped = e;
44: }
45:
46: public Throwable getWrapped() {
47: return wrapped;
48: }
49:
50: public String toString() {
51: StringBuffer b = new StringBuffer();
52:
53: b.append(super .toString());
54: if (getWrapped() != null) {
55: b.append(wrapped.toString());
56: }
57:
58: return b.toString();
59: }
60:
61: public void printStackTrace() {
62: super .printStackTrace();
63: if (getWrapped() != null) {
64: wrapped.printStackTrace();
65: }
66: }
67:
68: public void printStackTrace(PrintStream s) {
69: super .printStackTrace(s);
70: if (getWrapped() != null) {
71: wrapped.printStackTrace(s);
72: }
73: }
74:
75: public void printStackTrace(PrintWriter s) {
76: super.printStackTrace(s);
77: if (getWrapped() != null) {
78: wrapped.printStackTrace(s);
79: }
80: }
81: }
|