mirror of
https://github.com/apache/jclouds.git
synced 2025-02-17 23:46:13 +00:00
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)
|
if (job == null)
|
||||||
return false;
|
return false;
|
||||||
logger.trace("%s: looking for job status %s: currently: %s", job.getId(), 1, job.getStatus());
|
logger.trace("%s: looking for job status %s: currently: %s", job.getId(), 1, job.getStatus());
|
||||||
if (job.getError() != null)
|
if (job.getError() != null) {
|
||||||
throw new IllegalStateException(String.format("job %s failed with exception %s", job.getId(), job.getError()
|
// TODO: create a typed error
|
||||||
|
throw new RuntimeException(String.format("job %s failed with exception %s", job.getId(), job.getError()
|
||||||
.toString()));
|
.toString()));
|
||||||
|
}
|
||||||
return job.getStatus() > 0;
|
return job.getStatus() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user