01: /*
02: * Copyright 2004-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: *
16: */
17:
18: package org.jpublish;
19:
20: import java.io.PrintWriter;
21:
22: /** A base class for runtime exceptions.
23:
24: @author Anthony Eden
25: */
26:
27: public class JPublishRuntimeException extends RuntimeException {
28:
29: private Throwable t;
30:
31: /** Construct a JPublishRuntimeException. */
32:
33: public JPublishRuntimeException() {
34: super ();
35: }
36:
37: /** Construct a JPublishRuntimeException.
38:
39: @param message The error message
40: */
41:
42: public JPublishRuntimeException(String message) {
43: super (message);
44: }
45:
46: /** Construct a new JPublishRuntimeException with the given message
47: and nested exception.
48:
49: @param message The error message
50: @param t The nested exception
51: */
52:
53: public JPublishRuntimeException(String message, Throwable t) {
54: super (message);
55: this .t = t;
56: }
57:
58: /** Print the current stack trace.
59:
60: @param out The PrintWriter to print to
61: */
62:
63: public void printStackTrace(PrintWriter out) {
64: if (t != null) {
65: t.printStackTrace(out);
66: }
67: super.printStackTrace(out);
68: }
69:
70: }
|