Search code examples
javaexceptionexecutorservicefuturetask

ExecutionException thrown but without a cause


I have a futures task that is doing some I/O operations over the socket to a server. When I use the get() method of the task to retrieve the result, I am getting ExecutionException, but with no cause i.e. getCause() returns null. In what scenario does this happen? I mean, I'm getting this exception since the task threw some exception right , but how can it go missing?


Solution

  • throw null;
    

    is legal in Java, but I've never seen that in the wild.