better error on network timeouts

This commit is contained in:
Adrian Cole 2011-07-23 10:18:18 +10:00
parent 162214f209
commit 7d93c86588
1 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,9 @@ public class TaskSuccess implements Predicate<URI> {
logger.trace("looking for status on task %s", taskId); logger.trace("looking for status on task %s", taskId);
Task task = client.getTask(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()); logger.trace("%s: looking for status %s: currently: %s", task, TaskStatus.SUCCESS, task.getStatus());
if (task.getStatus() == TaskStatus.ERROR) if (task.getStatus() == TaskStatus.ERROR)
throw new RuntimeException("error on task: " + task.getHref() + " error: " + task.getError()); throw new RuntimeException("error on task: " + task.getHref() + " error: " + task.getError());