public static <T extends Throwable> RuntimeException rethrow(final Throwable t, Class<T> allowedType) throws T { rethrowIfError(t); throw (T) peel(t, allowedType, null); }
public static RuntimeException rethrow(final Throwable t) { rethrowIfError(t); throw peel(t); }
public static RuntimeException rethrow(final Throwable t) { rethrowIfError(t); throw peel(t); }
public static RuntimeException rethrow(final Throwable t, RuntimeExceptionFactory runtimeExceptionFactory) { rethrowIfError(t); throw (RuntimeException) peel(t, null, null, runtimeExceptionFactory); }
/** * This rethrow the exception providing an allowed Exception in first priority, even it is a Runtime exception */ public static <T extends Throwable> RuntimeException rethrowAllowedTypeFirst(final Throwable t, Class<T> allowedType) throws T { rethrowIfError(t); if (allowedType.isAssignableFrom(t.getClass())) { throw (T) t; } else { throw peel(t); } }
public static <T extends Throwable> RuntimeException rethrow(final Throwable t, Class<T> allowedType) throws T { rethrowIfError(t); throw (T) peel(t, allowedType, null); }
/** * This rethrow the exception providing an allowed Exception in first priority, even it is a Runtime exception */ public static <T extends Throwable> RuntimeException rethrowAllowedTypeFirst(final Throwable t, Class<T> allowedType) throws T { rethrowIfError(t); if (allowedType.isAssignableFrom(t.getClass())) { throw (T) t; } else { throw peel(t); } }
public static RuntimeException rethrow(final Throwable t, RuntimeExceptionFactory runtimeExceptionFactory) { rethrowIfError(t); throw (RuntimeException) peel(t, null, null, runtimeExceptionFactory); }