@Test public void retryableExceptionWithRetryOtherAsIndirectCauseIsCausedByRetryOther() { SafeIoException safeIoException = new SafeIoException( "Some I/O problem", QosException.retryOther(createUrl())); RetryableException retryableException = createRetryableException(safeIoException); assertThat(FastFailoverProxy.isCausedByRetryOther(retryableException)).isTrue(); }
@VisibleForTesting static boolean isCausedByRetryOther(Throwable throwable) { Throwable cause = throwable; while (cause != null) { if (cause instanceof QosException.RetryOther) { return true; } if (cause instanceof UnknownRemoteException && ((UnknownRemoteException) cause).getStatus() == 308) { return true; } cause = cause.getCause(); } return false; }
FastFailoverProxy extends AbstractInvocationHandler { @VisibleForTesting static boolean isCausedByRetryOther(Throwable throwable) { Throwable cause = throwable; while (cause != null) { if (cause instanceof QosException.RetryOther) { return true; } if (cause instanceof UnknownRemoteException && ((UnknownRemoteException) cause).getStatus() == 308) { return true; } cause = cause.getCause(); } return false; } }
FastFailoverProxy extends AbstractInvocationHandler { @VisibleForTesting static boolean isCausedByRetryOther(Throwable throwable) { Throwable cause = throwable; while (cause != null) { if (cause instanceof QosException.RetryOther) { return true; } if (cause instanceof UnknownRemoteException && ((UnknownRemoteException) cause).getStatus() == 308) { return true; } cause = cause.getCause(); } return false; } private  FastFailoverProxy(Supplier<T> delegate, Clock clock); }
FastFailoverProxy extends AbstractInvocationHandler { @VisibleForTesting static boolean isCausedByRetryOther(Throwable throwable) { Throwable cause = throwable; while (cause != null) { if (cause instanceof QosException.RetryOther) { return true; } if (cause instanceof UnknownRemoteException && ((UnknownRemoteException) cause).getStatus() == 308) { return true; } cause = cause.getCause(); } return false; } private  FastFailoverProxy(Supplier<T> delegate, Clock clock); static U newProxyInstance(Class<U> interfaceClass, Supplier<U> delegate); }
FastFailoverProxy extends AbstractInvocationHandler { @VisibleForTesting static boolean isCausedByRetryOther(Throwable throwable) { Throwable cause = throwable; while (cause != null) { if (cause instanceof QosException.RetryOther) { return true; } if (cause instanceof UnknownRemoteException && ((UnknownRemoteException) cause).getStatus() == 308) { return true; } cause = cause.getCause(); } return false; } private  FastFailoverProxy(Supplier<T> delegate, Clock clock); static U newProxyInstance(Class<U> interfaceClass, Supplier<U> delegate);  }