Possible Duplicate:
Handling exceptions from Java ExecutorService tasks
I use the ExecutorService
from Java for coordinating Threads.
For starting the threads I use
pool = new ExecutorService(2);
callableResults = pool.invokeAll(threads);
To collect the result, I use future.get()
for each thread.
"threads" is a List of Objects from a Class which implements Callable
and overrides call()
.
Now Ive got the following problem. The method call()
does throw various specific exceptions. invokeAll()
and future.get()
throw only InterruptedException
.
Where can I catch my specific exceptions which I throw in call()
? Or do I have to handle them there? If one of those exceptions is thrown, is the result then a InterruptedException
?