@Test public void testPropagateCheckedExceptionWithMessage() throws Exception { String extraMsg = "my message"; Exception tothrow = new Exception("simulated"); try { throw Exceptions.propagate(extraMsg, tothrow); } catch (RuntimeException e) { assertEquals(e.getMessage(), "my message"); assertEquals(e.getCause(), tothrow); } }
public static RuntimeException propagate(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } Throwables.propagateIfPossible(checkNotNull(throwable)); throw new PropagatedRuntimeException(throwable); }
Exceptions { public static RuntimeException propagate(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } Throwables.propagateIfPossible(checkNotNull(throwable)); throw new PropagatedRuntimeException(throwable); } }
Exceptions { public static RuntimeException propagate(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } Throwables.propagateIfPossible(checkNotNull(throwable)); throw new PropagatedRuntimeException(throwable); }  }
Exceptions { public static RuntimeException propagate(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } Throwables.propagateIfPossible(checkNotNull(throwable)); throw new PropagatedRuntimeException(throwable); }  static boolean isPrefixBoring(Throwable t); static RuntimeException propagate(Throwable throwable); static RuntimeException propagate(String msg, Throwable throwable); static void propagateIfFatal(Throwable throwable); @SuppressWarnings("unchecked") static T getFirstThrowableOfType(Throwable from, Class<T> clazz); static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter); static Throwable getFirstInteresting(Throwable throwable); static Throwable collapse(Throwable source); static Throwable collapseIncludingAllCausalMessages(Throwable source); static Throwable collapse(Throwable source, boolean collapseCausalChain); static RuntimeException propagateCollapsed(Throwable source); static String collapseText(Throwable t); static String collapseTextIncludingAllCausalMessages(Throwable t); static RuntimeException propagate(Collection<? extends Throwable> exceptions); static RuntimeException propagate(String prefix, Collection<? extends Throwable> exceptions); static Throwable create(Collection<? extends Throwable> exceptions); static RuntimeException create(@Nullable String prefix, Collection<? extends Throwable> exceptions); static boolean isPrefixImportant(Throwable t); static String getPrefixText(Throwable t); }
Exceptions { public static RuntimeException propagate(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } Throwables.propagateIfPossible(checkNotNull(throwable)); throw new PropagatedRuntimeException(throwable); }  static boolean isPrefixBoring(Throwable t); static RuntimeException propagate(Throwable throwable); static RuntimeException propagate(String msg, Throwable throwable); static void propagateIfFatal(Throwable throwable); @SuppressWarnings("unchecked") static T getFirstThrowableOfType(Throwable from, Class<T> clazz); static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter); static Throwable getFirstInteresting(Throwable throwable); static Throwable collapse(Throwable source); static Throwable collapseIncludingAllCausalMessages(Throwable source); static Throwable collapse(Throwable source, boolean collapseCausalChain); static RuntimeException propagateCollapsed(Throwable source); static String collapseText(Throwable t); static String collapseTextIncludingAllCausalMessages(Throwable t); static RuntimeException propagate(Collection<? extends Throwable> exceptions); static RuntimeException propagate(String prefix, Collection<? extends Throwable> exceptions); static Throwable create(Collection<? extends Throwable> exceptions); static RuntimeException create(@Nullable String prefix, Collection<? extends Throwable> exceptions); static boolean isPrefixImportant(Throwable t); static String getPrefixText(Throwable t);  }