XmlRpcException.java
Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one
00003  * or more contributor license agreements.  See the NOTICE file
00004  * distributed with this work for additional information
00005  * regarding copyright ownership.  The ASF licenses this file
00006  * to you under the Apache License, Version 2.0 (the
00007  * "License"); you may not use this file except in compliance
00008  * with the License.  You may obtain a copy of the License at
00009  *
00010  *   http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing,
00013  * software distributed under the License is distributed on an
00014  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00015  * KIND, either express or implied.  See the License for the
00016  * specific language governing permissions and limitations
00017  * under the License.    
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 }


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:49