001/*
002    Licensed to the Apache Software Foundation (ASF) under one
003    or more contributor license agreements.  See the NOTICE file
004    distributed with this work for additional information
005    regarding copyright ownership.  The ASF licenses this file
006    to you under the Apache License, Version 2.0 (the
007    "License"); you may not use this file except in compliance
008    with 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,
013    software distributed under the License is distributed on an
014    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015    KIND, either express or implied.  See the License for the
016    specific language governing permissions and limitations
017    under the License.
018 */
019package org.apache.wiki.api.exceptions;
020
021
022/**
023 *  Provides a generic PluginException.  This is the kind of an exception that the plugins should throw.
024 */
025public class PluginException  extends WikiException {
026
027    private static final long serialVersionUID = -289900047240960332L;
028
029    private final Throwable m_throwable;
030
031    /**
032     *  Create a PluginException.
033     *
034     *  @param message exception message.
035     */
036    public PluginException( String message ) {
037        super( message );
038        m_throwable = null;
039    }
040
041    /**
042     *  Create a PluginException with the given original exception wrapped.
043     *
044     *  @param message exception message.
045     *  @param original The original exception.
046     */
047    public PluginException( String message, Throwable original ) {
048        super( message, original );
049        m_throwable = original;
050    }
051
052    /**
053     *  Return the original exception.
054     *
055     *  @return The original exception.
056     */
057    public Throwable getRootThrowable() {
058        return m_throwable;
059    }
060
061}