ExecutionException thrown but without a cause
-
11-02-2021 - |
Pergunta
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?
Solução
throw null;
is legal in Java, but I've never seen that in the wild.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow