001/* $Id: PluginInvalidInputException.java 476205 2006-11-17 16:43:10Z dennisl $
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one or more
004 * contributor license agreements.  See the NOTICE file distributed with
005 * this work for additional information regarding copyright ownership.
006 * The ASF licenses this file to You under the Apache License, Version 2.0
007 * (the "License"); you may not use this file except in compliance with
008 * the License.  You may obtain a copy of the License at
009 * 
010 *      http://www.apache.org/licenses/LICENSE-2.0
011 * 
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */ 
018
019package org.apache.commons.digester.plugins;
020
021/**
022 * Thrown when an error occurs due to bad data in the file being parsed.
023 *
024 * @since 1.6
025 */
026public class PluginInvalidInputException extends PluginException {
027
028    private Throwable cause = null;
029
030    /**
031     * @param cause underlying exception that caused this to be thrown
032     */
033    public PluginInvalidInputException(Throwable cause) {
034        this(cause.getMessage());
035        this.cause = cause;
036    }
037
038    /**
039     * @param msg describes the reason this exception is being thrown.
040     */
041    public PluginInvalidInputException(String msg) {
042        super(msg);
043    }
044
045    /**
046     * @param msg describes the reason this exception is being thrown.
047     * @param cause underlying exception that caused this to be thrown
048     */
049    public PluginInvalidInputException(String msg, Throwable cause) {
050        this(msg);
051        this.cause = cause;
052    }
053    
054    /**
055     * Return the cause of this exception (if any) as specified in the
056     * exception constructor.
057     * 
058     * @since 1.8
059     */
060    public Throwable getCause() {
061        return cause;
062    }
063}