[ https://issues.apache.org/jira/browse/MESOS-2718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14613099#comment-14613099 ]
haosdent commented on MESOS-2718: --------------------------------- Hmm, but ex == ex.getCause() is a default behaviour in JDK. > Future created by State.names() throws an Illegal ExecutionException > -------------------------------------------------------------------- > > Key: MESOS-2718 > URL: https://issues.apache.org/jira/browse/MESOS-2718 > Project: Mesos > Issue Type: Bug > Components: java api > Affects Versions: 0.22.1 > Environment: OSX, Mesos 0.22.1 > Reporter: Matthias Veit > > During application startup, we call call org.apache.mesos.state.State.names(). > This will return a java Future. > Everything is fine in the success case. > In the error case, the future can throw either an InterruptedException, > ExecutionException or a RuntimeException. > The ExecutionException indicates, that the future was not successful. > This is the text from the javadoc: > Exception thrown when attempting to retrieve the result of a task that > aborted by throwing an exception. This exception can be inspected using the > Throwable.getCause() method. See here: > https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html > The ExecutionException thrown by mesos in the above method does not hold a > reference to the root cause, but returns a reference to this as cause (ex == > ex.getCause()). > ExecutionException really is a wrapper exception to indicate success or > failure of the java future and should always have a root cause. > With the current implementation we can't distinguish between a Future error > or an application error. Please provide always the exception cause. -- This message was sent by Atlassian JIRA (v6.3.4#6332)