Skip to content

Commit 6ccf390

Browse files
Handle InterruptedException
1 parent 124a37d commit 6ccf390

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

taskmaster-service-helper/src/main/java/com/github/bordertech/taskmaster/service/impl/ServiceHelperProviderDefault.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ public synchronized <S extends Serializable, T extends Serializable> ResultHolde
103103
ProcessingMutableResult serviceResult;
104104
try {
105105
serviceResult = future.get();
106-
} catch (InterruptedException | ExecutionException e) {
106+
} catch (InterruptedException e) {
107+
// Restore interrupted state...
108+
Thread.currentThread().interrupt();
109+
throw new AsyncServiceException("Getting result from Future but thread was interrupted. " + e.getMessage(), e);
110+
} catch (ExecutionException e) {
107111
throw new AsyncServiceException("Could not get result from the future. " + e.getMessage(), e);
108112
}
109113
ResultHolder result;

0 commit comments

Comments
 (0)