@Test(expectedExceptions = IllegalStateException.class) public void testPropagateStandardExceptionIllegalStateExceptionNestedInHttpResponseException() throws Throwable { Exception e = new IllegalStateException(); propagateIfPossible(new HttpResponseException("goo", createNiceMock(HttpCommand.class), null, e), ImmutableSet.<TypeToken<? extends Throwable>> of()); }
public static void propagateIfPossible(Throwable exception, Iterable<TypeToken<? extends Throwable>> throwables) throws Throwable { for (TypeToken<? extends Throwable> type : throwables) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, (Class<Throwable>) type.getRawType()); if (throwable != null) { throw throwable; } } for (Class<? extends Throwable> propagatableExceptionType : PROPAGATABLE_EXCEPTION_TYPES) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, propagatableExceptionType); if (throwable != null) { throw throwable; } } }
Throwables2 { public static void propagateIfPossible(Throwable exception, Iterable<TypeToken<? extends Throwable>> throwables) throws Throwable { for (TypeToken<? extends Throwable> type : throwables) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, (Class<Throwable>) type.getRawType()); if (throwable != null) { throw throwable; } } for (Class<? extends Throwable> propagatableExceptionType : PROPAGATABLE_EXCEPTION_TYPES) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, propagatableExceptionType); if (throwable != null) { throw throwable; } } } }
Throwables2 { public static void propagateIfPossible(Throwable exception, Iterable<TypeToken<? extends Throwable>> throwables) throws Throwable { for (TypeToken<? extends Throwable> type : throwables) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, (Class<Throwable>) type.getRawType()); if (throwable != null) { throw throwable; } } for (Class<? extends Throwable> propagatableExceptionType : PROPAGATABLE_EXCEPTION_TYPES) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, propagatableExceptionType); if (throwable != null) { throw throwable; } } }  }
Throwables2 { public static void propagateIfPossible(Throwable exception, Iterable<TypeToken<? extends Throwable>> throwables) throws Throwable { for (TypeToken<? extends Throwable> type : throwables) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, (Class<Throwable>) type.getRawType()); if (throwable != null) { throw throwable; } } for (Class<? extends Throwable> propagatableExceptionType : PROPAGATABLE_EXCEPTION_TYPES) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, propagatableExceptionType); if (throwable != null) { throw throwable; } } }  static Predicate<Throwable> containsThrowable(final Class<T> throwableType); @SuppressWarnings("unchecked") static T getFirstThrowableOfType(Throwable from, Class<T> clazz); static T propagateAuthorizationOrOriginalException(Exception e); static void propagateIfPossible(Throwable exception, Iterable<TypeToken<? extends Throwable>> throwables); }
Throwables2 { public static void propagateIfPossible(Throwable exception, Iterable<TypeToken<? extends Throwable>> throwables) throws Throwable { for (TypeToken<? extends Throwable> type : throwables) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, (Class<Throwable>) type.getRawType()); if (throwable != null) { throw throwable; } } for (Class<? extends Throwable> propagatableExceptionType : PROPAGATABLE_EXCEPTION_TYPES) { Throwable throwable = Throwables2.getFirstThrowableOfType(exception, propagatableExceptionType); if (throwable != null) { throw throwable; } } }  static Predicate<Throwable> containsThrowable(final Class<T> throwableType); @SuppressWarnings("unchecked") static T getFirstThrowableOfType(Throwable from, Class<T> clazz); static T propagateAuthorizationOrOriginalException(Exception e); static void propagateIfPossible(Throwable exception, Iterable<TypeToken<? extends Throwable>> throwables);  }