mirror of https://github.com/apache/jclouds.git
throw exception as opposed to returning false when a job errors
This commit is contained in:
parent
6b2cfa7f3a
commit
d53d473481
|
@ -55,9 +55,11 @@ public class JobComplete implements Predicate<Long> {
|
|||
if (job == null)
|
||||
return false;
|
||||
logger.trace("%s: looking for job status %s: currently: %s", job.getId(), 1, job.getStatus());
|
||||
if (job.getError() != null)
|
||||
throw new IllegalStateException(String.format("job %s failed with exception %s", job.getId(), job.getError()
|
||||
if (job.getError() != null) {
|
||||
// TODO: create a typed error
|
||||
throw new RuntimeException(String.format("job %s failed with exception %s", job.getId(), job.getError()
|
||||
.toString()));
|
||||
}
|
||||
return job.getStatus() > 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue