Avoid deprecated Guava methods in {Remote,}Retrier
Change-Id: Ibe3c7119a1dfe171e2f63e1a947bc94a07a03ac4
Closes #10899.
Change-Id: Ibe3c7119a1dfe171e2f63e1a947bc94a07a03ac4
PiperOrigin-RevId: 298861287
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java
index fc8064f..7bb163a 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java
@@ -107,16 +107,18 @@
/**
* Execute a callable with retries. {@link IOException} and {@link InterruptedException} are
- * propagated directly to the caller. All other exceptions are wrapped in {@link RuntimeError}.
+ * propagated directly to the caller. All other exceptions are wrapped in {@link
+ * RuntimeException}.
*/
@Override
public <T> T execute(Callable<T> call) throws IOException, InterruptedException {
try {
return super.execute(call);
} catch (Exception e) {
- Throwables.propagateIfInstanceOf(e, IOException.class);
- Throwables.propagateIfInstanceOf(e, InterruptedException.class);
- throw Throwables.propagate(e);
+ Throwables.throwIfInstanceOf(e, IOException.class);
+ Throwables.throwIfInstanceOf(e, InterruptedException.class);
+ Throwables.throwIfUnchecked(e);
+ throw new RuntimeException(e);
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/remote/Retrier.java b/src/main/java/com/google/devtools/build/lib/remote/Retrier.java
index 949050d..9fa0208 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/Retrier.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/Retrier.java
@@ -239,7 +239,7 @@
return r;
} catch (Exception e) {
circuitBreaker.recordFailure();
- Throwables.propagateIfInstanceOf(e, InterruptedException.class);
+ Throwables.throwIfInstanceOf(e, InterruptedException.class);
if (State.TRIAL_CALL.equals(circuitState)) {
throw e;
}