com.indeed.util.core.Throwables2 Maven / Gradle / Ivy
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);
}
}