
com.pippsford.common.UncheckedCheckedException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-utils Show documentation
Show all versions of common-utils Show documentation
Code that seems to me to have utility across multiple projects
The newest version!
package com.pippsford.common;
import java.util.Objects;
/**
* A wrapper for a checked exception where the API requires only unchecked exceptions may be thrown.
*
* @author Simon Greatrix on 06/01/2021.
*/
public class UncheckedCheckedException extends RuntimeException {
/**
* New instance.
*
* @param throwable the checked exception
*/
public UncheckedCheckedException(Exception throwable) {
super(Objects.requireNonNull(throwable));
}
/**
* New instance.
*
* @param message an additional message
* @param throwable the checked exception
*/
public UncheckedCheckedException(String message, Exception throwable) {
super(message, Objects.requireNonNull((throwable)));
}
@Override
public synchronized Exception getCause() {
return (Exception) super.getCause();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy