From 0e794c47880c2b4b01e021fc1d4d8d7febd5d4eb Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 27 Feb 2011 20:59:54 -0800 Subject: [PATCH] return false on executionexception --- .../java/org/jclouds/predicates/RetryablePredicate.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/main/java/org/jclouds/predicates/RetryablePredicate.java b/core/src/main/java/org/jclouds/predicates/RetryablePredicate.java index a8e284e525..e011e778c0 100644 --- a/core/src/main/java/org/jclouds/predicates/RetryablePredicate.java +++ b/core/src/main/java/org/jclouds/predicates/RetryablePredicate.java @@ -20,11 +20,13 @@ package org.jclouds.predicates; import java.util.Date; +import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import javax.annotation.Resource; import org.jclouds.logging.Logger; +import org.jclouds.util.Throwables2; import com.google.common.base.Predicate; @@ -72,6 +74,12 @@ public class RetryablePredicate implements Predicate { } } catch (InterruptedException e) { logger.warn(e, "predicate %s on %s interrupted, returning false", input, predicate); + } catch (RuntimeException e) { + ExecutionException exec = Throwables2.getFirstThrowableOfType(e, ExecutionException.class); + if (exec != null) + logger.warn(exec, "predicate %s on %s error, returning false", input, predicate); + else + throw e; } return false; }