// NoSuccessException.java
//
//    senger@ebi.ac.uk
//    February 2003

package org.biomoby.shared;

/** 
 * A specific exception indicating that a request should not be
 * fulfilled because something was not correctly specified, or was not
 * found. The exception is raised if some "business logic" failed,
 * but not because of a communiucation failure (that would be
 * indicated by a more general {@link MobyException}).
 *<p>
 * @author <A HREF="mailto:senger@ebi.ac.uk">Martin Senger</A>
 * @version $Id: NoSuccessException.java,v 1.3 2006/07/07 04:12:40 gordonp Exp $
 */

public class NoSuccessException extends Exception {

  
    private static final long serialVersionUID = 4048790148043127088L;
    /** @serial
     */
    private Object culprit = null;

    public NoSuccessException() {
	super();
    }

    /******************************************************************************
     * A constructor specifying a reason and the potential culprit for
     * this exception.
     *<p>
     * @param reason message/reason
     * @param culprit an object who was not found, who failed to do something, etc.
     ******************************************************************************/
    public NoSuccessException (String reason, Object culprit) {
	super (reason);
	this.culprit = culprit;
    }

    /******************************************************************************
     * Retrieve the culprit. 
     *
     * @return an object representing the cause of the failure
     ******************************************************************************/
    public Object getCulprit() {
        return culprit;
    }
}
