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.search.rdm;
07:
08: import java.io.*;
09:
10: public class RDMException extends Exception {
11:
12: public RDMException(String s) {
13: super (s);
14: }
15:
16: public RDMException(Exception cause) {
17: this .cause = cause;
18: }
19:
20: public RDMException(String s, Exception cause) {
21: super (s);
22: this .cause = cause;
23: }
24:
25: public Exception getCauseException() {
26: return cause;
27: }
28:
29: public String toString() {
30: String s = super .toString();
31: if (cause == null)
32: return s;
33: else
34: return s + ", <Cause: " + cause + ">";
35: }
36:
37: public void printStackTrace() {
38: super .printStackTrace();
39: if (cause != null)
40: cause.printStackTrace();
41: }
42:
43: public void printStackTrace(PrintStream ps) {
44: super .printStackTrace(ps);
45: if (cause != null)
46: cause.printStackTrace(ps);
47: }
48:
49: public void printStackTrace(PrintWriter pw) {
50: super .printStackTrace(pw);
51: if (cause != null)
52: cause.printStackTrace(pw);
53: }
54:
55: /** chained exception */
56: Exception cause;
57:
58: }
|