From 7d93c8658878befef68ccc3f17f142b8b81a4fdf Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sat, 23 Jul 2011 10:18:18 +1000 Subject: [PATCH] better error on network timeouts --- .../main/java/org/jclouds/vcloud/predicates/TaskSuccess.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/vcloud/src/main/java/org/jclouds/vcloud/predicates/TaskSuccess.java b/common/vcloud/src/main/java/org/jclouds/vcloud/predicates/TaskSuccess.java index d83b318d8f..2dcb16a881 100644 --- a/common/vcloud/src/main/java/org/jclouds/vcloud/predicates/TaskSuccess.java +++ b/common/vcloud/src/main/java/org/jclouds/vcloud/predicates/TaskSuccess.java @@ -54,6 +54,9 @@ public class TaskSuccess implements Predicate { logger.trace("looking for status on task %s", taskId); Task task = client.getTask(taskId); + // perhaps task isn't available, yet + if (task == null) + return false; logger.trace("%s: looking for status %s: currently: %s", task, TaskStatus.SUCCESS, task.getStatus()); if (task.getStatus() == TaskStatus.ERROR) throw new RuntimeException("error on task: " + task.getHref() + " error: " + task.getError());