001/* $Id: PluginInvalidInputException.java 992060 2010-09-02 19:09:47Z simonetripodi $
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 static final long serialVersionUID = 1L;
029    private Throwable cause = null;
030
031    /**
032     * @param cause underlying exception that caused this to be thrown
033     */
034    public PluginInvalidInputException(Throwable cause) {
035        this(cause.getMessage());
036        this.cause = cause;
037    }
038
039    /**
040     * @param msg describes the reason this exception is being thrown.
041     */
042    public PluginInvalidInputException(String msg) {
043        super(msg);
044    }
045
046    /**
047     * @param msg describes the reason this exception is being thrown.
048     * @param cause underlying exception that caused this to be thrown
049     */
050    public PluginInvalidInputException(String msg, Throwable cause) {
051        this(msg);
052        this.cause = cause;
053    }
054    
055    /**
056     * Return the cause of this exception (if any) as specified in the
057     * exception constructor.
058     * 
059     * @since 1.8
060     */
061    @Override
062    public Throwable getCause() {
063        return cause;
064    }
065}