01: /* CVS ID: $Id: WebMailException.java,v 1.1.1.1 2002/10/02 18:42:48 wastl Exp $ */
02: package net.wastl.webmail.exceptions;
03:
04: import java.io.*;
05:
06: /*
07: * WebMailException.java
08: *
09: * Created: Thu Feb 4 16:55:06 1999
10: *
11: * Copyright (C) 1999-2000 Sebastian Schaffert
12: *
13: * This program is free software; you can redistribute it and/or
14: * modify it under the terms of the GNU General Public License
15: * as published by the Free Software Foundation; either version 2
16: * of the License, or (at your option) any later version.
17: *
18: * This program is distributed in the hope that it will be useful,
19: * but WITHOUT ANY WARRANTY; without even the implied warranty of
20: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21: * GNU General Public License for more details.
22: *
23: * You should have received a copy of the GNU General Public License
24: * along with this program; if not, write to the Free Software
25: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26: */
27: /**
28: * This is a generic WebMail Exception.
29: *
30: *
31: * @author Sebastian Schaffert
32: * @version $Revision: 1.1.1.1 $
33: */
34:
35: public class WebMailException extends Exception {
36:
37: Exception nested;
38:
39: public WebMailException() {
40: super ();
41: }
42:
43: public WebMailException(String s) {
44: super (s);
45: }
46:
47: public WebMailException(Exception ex) {
48: super (ex.getMessage());
49: nested = ex;
50: }
51:
52: public void printStackTrace(PrintStream ps) {
53: super .printStackTrace(ps);
54: if (nested != null) {
55: try {
56: ps.println("==> Nested exception: ");
57: } catch (Exception ex) {
58: }
59: nested.printStackTrace(ps);
60: }
61: }
62:
63: public void printStackTrace(PrintWriter ps) {
64: super .printStackTrace(ps);
65: if (nested != null) {
66: try {
67: ps.println("==> Nested exception: ");
68: } catch (Exception ex) {
69: }
70: nested.printStackTrace(ps);
71: }
72: }
73:
74: } // InvalidPasswordException
|