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

no.nav.common.utils.ExceptionUtils Maven / Gradle / Ivy

The newest version!
package no.nav.common.utils;

public class ExceptionUtils {
    public static RuntimeException throwUnchecked(Throwable e) {
        return ExceptionUtils.genericThrow(e);
    }

    private static  T genericThrow(Throwable e) throws T {
        throw (T) e;
    }

    public static Throwable getRootCause(Throwable throwable) {
        Throwable cause = throwable.getCause();
        if (cause != null) {
            return getRootCause(cause);
        } else {
            return throwable;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy