2 * Copyright 1999-2004 The Apache Software Foundation.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * CVS XindiceRuntimeException.java,v 1.5 2004/02/08 02:59:39 vgritsenko Exp $
20 package net.jxta.impl.xindice.util;
23 import java.io.PrintStream;
24 import java.io.PrintWriter;
28 * A XindiceRuntimeException is the base class for all Xindice related RuntimeExceptions.
30 * @version CVS $Revision$, $Date$
32 public class XindiceRuntimeException extends RuntimeException {
33 protected Throwable cause;
35 public XindiceRuntimeException() {}
37 public XindiceRuntimeException(String message) {
41 public XindiceRuntimeException(Throwable cause) {
46 public XindiceRuntimeException(String message, Throwable cause) {
52 public void printStackTrace() {
53 printStackTrace(System.err);
57 public void printStackTrace(PrintStream s) {
58 super.printStackTrace(s);
59 if (this.cause != null) {
60 s.print("Caused by: ");
61 this.cause.printStackTrace(s);
66 public void printStackTrace(PrintWriter s) {
67 super.printStackTrace(s);
68 if (this.cause != null) {
69 s.print("Caused by: ");
70 this.cause.printStackTrace(s);
75 public Throwable getCause() {