Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 package org.apache.xmlrpc;
00020
00021 import java.io.PrintStream;
00022 import java.io.PrintWriter;
00023
00031 public class XmlRpcException extends Exception {
00032 private static final long serialVersionUID = 3258693217049325618L;
00033
00038 public final int code;
00039
00045 public final Throwable linkedException;
00046
00051 public XmlRpcException(int pCode, String pMessage) {
00052 this(pCode, pMessage, null);
00053 }
00054
00060 public XmlRpcException(String pMessage, Throwable pLinkedException) {
00061 this(0, pMessage, pLinkedException);
00062 }
00063
00068 public XmlRpcException(String pMessage) {
00069 this(0, pMessage, null);
00070 }
00071
00078 public XmlRpcException(int pCode, String pMessage, Throwable pLinkedException) {
00079 super(pMessage);
00080 code = pCode;
00081 linkedException = pLinkedException;
00082 }
00083
00084 public void printStackTrace(PrintStream pStream) {
00085 super.printStackTrace(pStream);
00086 if (linkedException != null) {
00087 pStream.println("Caused by:");
00088 linkedException.printStackTrace(pStream);
00089 }
00090 }
00091
00092 public void printStackTrace(PrintWriter pWriter) {
00093 super.printStackTrace(pWriter);
00094 if (linkedException != null) {
00095 pWriter.println("Caused by:");
00096 linkedException.printStackTrace(pWriter);
00097 }
00098 }
00099
00100 public Throwable getCause() {
00101 return linkedException;
00102 }
00103 }