com.chutneytesting.tools.UncheckedException Maven / Gradle / Ivy
package com.chutneytesting.tools;
/**
* Specific {@link RuntimeException} thrown when checked {@link Exception} occurs in ThrowingFunctions.
* Checked {@link Exception} is set as cause.
*
* @see ThrowingFunction#toUnchecked(ThrowingFunction)
*/
@SuppressWarnings("serial")
public class UncheckedException extends RuntimeException {
private UncheckedException(Exception checkedException) {
super("Occurred in silenced function", checkedException);
}
public static RuntimeException throwUncheckedException(Exception e) {
if (e instanceof RuntimeException) {
return (RuntimeException) e;
} else {
return new UncheckedException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy