1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.geronimo.ews.ws4j2ee.parsers;
18
19 /***
20 * <p>This denotes the Exception occured at the code genaration.
21 * There is a isssue of wrapping the Exception such that JDK1.3 compatibility.
22 * This code write same way as it was done at the RemoteException.</p>
23 */
24 public class ParserFault extends Exception {
25 /***
26 * Nested Exception to hold wrapped exception.
27 * <p>This field predates the general-purpose exception chaining facility.
28 * The {@link Throwable#getCause()} method is now the preferred means of
29 * obtaining this information.</p>
30 *
31 * @serial
32 */
33 public Throwable detail;
34
35 public ParserFault(Exception e) {
36 initCause(null);
37 detail = e;
38 }
39
40 public ParserFault(String message) {
41 super(message);
42 }
43
44 /***
45 * Constructs a <code>Exception</code> with the specified
46 * detail message and nested exception.
47 *
48 * @param s the detail message
49 * @param ex the nested exception
50 */
51 public ParserFault(String s, Throwable ex) {
52 super(s);
53 initCause(null);
54 detail = ex;
55 }
56
57 /***
58 * Returns the detail message, including the message from the nested
59 * exception if there is one.
60 *
61 * @return the detail message, including nested exception message if any
62 */
63 public String getMessage() {
64 if (detail == null) {
65 return super.getMessage();
66 } else {
67 return super.getMessage() + "; nested exception is: \n\t" +
68 detail.toString();
69 }
70 }
71
72 /***
73 * Returns the wrapped exception (the <i>cause</i>).
74 *
75 * @return the wrapped exception, which may be <tt>null</tt>.
76 */
77 public Throwable getCause() {
78 return detail;
79 }
80 }