All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kiwiproject.test.logback.UncheckedJoranException Maven / Gradle / Ivy

There is a newer version: 3.7.0
Show newest version
package org.kiwiproject.test.logback;

import static org.kiwiproject.base.KiwiPreconditions.requireNotNull;

import ch.qos.logback.core.joran.spi.JoranException;

/**
 * Wraps a {@link JoranException} with an unchecked exception.
 */
public class UncheckedJoranException extends RuntimeException {

    /**
     * Construct an instance.
     *
     * @param message the message, which can be null
     * @param cause   the cause, which cannot be null
     * @throws IllegalArgumentException if cause is null
     */
    public UncheckedJoranException(String message, JoranException cause) {
        super(message, requireNotNull(cause));
    }

    /**
     * Construct an instance.
     *
     * @param cause the cause, which cannot be null
     * @throws IllegalArgumentException if cause is null
     */
    public UncheckedJoranException(JoranException cause) {
        super(requireNotNull(cause));
    }

    /**
     * Returns the cause of this exception.
     *
     * @return the {@link JoranException} which is the cause of this exception
     */
    @Override
    public synchronized JoranException getCause() {
        return (JoranException) super.getCause();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy