package net.ranides.assira.reflection;

/**
 * Unchecked exception thrown by all other methods.
 */
public class IReflectiveException extends RuntimeException {

    /**
     * Constructs new IReflectiveException
     *
     * @param message message
     */
    public IReflectiveException(String message) {
        super(message);
    }

    /**
     * Constructs new IReflectiveException
     *
     * @param message message
     * @param cause cause
     */
    public IReflectiveException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * Constructs new IReflectiveException
     *
     * @param cause cause
     */
    public IReflectiveException(Throwable cause) {
        super(cause);
    }

    /**
     * This exception is thrown if you executed some code reflectively and it threw exception
     */
    public static class CallException extends IReflectiveException {

        /**
         * Constructs new CallException
         *
         * @param cause cause
         */
        public CallException(Throwable cause) {
            super(cause);
        }

    }

    /**
     * This exception is thrown if framework was unable to execute reflectively some code
     * which should be accessible. Most of the time this exception is caused by IllegalAccessException.
     */
    public static class AbnormalException extends IReflectiveException {

        /**
         * Constructs new AbnormalException
         *
         * @param cause cause
         */
        public AbnormalException(Throwable cause) {
            super(cause);
        }

    }
}
