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

com.indeed.util.core.Throwables2 Maven / Gradle / Ivy

There is a newer version: 1.0.52-3042601
Show newest version
package com.indeed.util.core;

import com.google.common.base.Throwables;

/**
 * @author jplaisance
 */
public final class Throwables2 {

    public static  RuntimeException propagate(Throwable t, Class xClass) throws X {
        Throwables.propagateIfInstanceOf(t, xClass);
        throw Throwables.propagate(t);
    }

    public static  RuntimeException propagate(Throwable t, Class x1Class, Class x2Class) throws X1, X2 {
        Throwables.propagateIfInstanceOf(t, x1Class);
        Throwables.propagateIfInstanceOf(t, x2Class);
        throw Throwables.propagate(t);
    }

    public static  RuntimeException propagate(Throwable t, Class x1Class, Class x2Class, Class x3Class) throws X1, X2, X3 {
        Throwables.propagateIfInstanceOf(t, x1Class);
        Throwables.propagateIfInstanceOf(t, x2Class);
        Throwables.propagateIfInstanceOf(t, x3Class);
        throw Throwables.propagate(t);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy