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

io.datakernel.common.exception.UncheckedException Maven / Gradle / Ivy

package io.datakernel.common.exception;

import org.jetbrains.annotations.NotNull;

public final class UncheckedException extends RuntimeException {
	public UncheckedException(@NotNull Throwable cause) {
		super(cause);
	}

	@Override
	public Throwable fillInStackTrace() {
		return this;
	}

	@SuppressWarnings("unchecked")
	public  E propagate(@NotNull Class exceptionType) {
		Throwable cause = getCause();
		if (exceptionType.isAssignableFrom(cause.getClass())) {
			return (E) cause;
		}
		throw this;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy