mirror of https://github.com/apache/jclouds.git
return false on executionexception
This commit is contained in:
parent
54ab2aa82b
commit
0e794c4788
|
@ -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<T> implements Predicate<T> {
|
|||
}
|
||||
} 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue