mirror of https://github.com/apache/jclouds.git
Merge pull request #514 from andrewgaul/handle-timeout-exception
Propagate InterruptedException & TimeoutException
This commit is contained in:
commit
f27ece1b45
|
@ -58,6 +58,8 @@ public class ExceptionParsingListenableFuture<T> implements ListenableFuture<T>
|
||||||
public T get() throws InterruptedException, ExecutionException {
|
public T get() throws InterruptedException, ExecutionException {
|
||||||
try {
|
try {
|
||||||
return future.get();
|
return future.get();
|
||||||
|
} catch (InterruptedException ie) {
|
||||||
|
throw ie;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return attemptConvert(e);
|
return attemptConvert(e);
|
||||||
}
|
}
|
||||||
|
@ -72,6 +74,10 @@ public class ExceptionParsingListenableFuture<T> implements ListenableFuture<T>
|
||||||
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
|
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
|
||||||
try {
|
try {
|
||||||
return future.get(timeout, unit);
|
return future.get(timeout, unit);
|
||||||
|
} catch (InterruptedException ie) {
|
||||||
|
throw ie;
|
||||||
|
} catch (TimeoutException te) {
|
||||||
|
throw te;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return attemptConvert(e);
|
return attemptConvert(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue