/**
 * Copyright (c) 2009-2012 EBM WebSourcing, 2012-2013 Linagora
 * 
 * This program/library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or (at your
 * option) any later version.
 * 
 * This program/library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program/library; If not, see <http://www.gnu.org/licenses/>
 * for the GNU Lesser General Public License version 2.1.
 */
package org.ow2.petals.bc.sftp;

/**
 * An exception raised if the SU configuration is not valid.
 * @author Charles Casadei - EBM WebSourcing
 */
public class ConfigurationException extends Exception {

    private static final long serialVersionUID = 5410541548525106593L;

    /**
     * The error message.
     */
    private String originalMessage;

    /**
     * Default constructor.
     * 
     * @param message
     *            the error message
     */
    public ConfigurationException(final String message) {
        super("Configuration error : " + message);
        this.originalMessage = message;
    }

    public ConfigurationException(final Throwable throwable) {
        super("Configuration error : " + throwable.getMessage(), throwable);
        this.originalMessage = throwable.getMessage();
    }

    /**
     * Accessor on the error message given to the class constructor.
     * 
     * @return the error message
     */
    public final String getOriginalMessage() {
        return this.originalMessage;
    }
}
