}
private static ExecutionException unwrapException(Throwable cause, String messageFormat, Object... parameters) {
Throwable current = cause;
ExecutionException deepestCause = null;
while (current != null) {
if (current instanceof ExecutionException) {
deepestCause = (ExecutionException) current;
}
current = current.getCause();
}
if (deepestCause != null) {
return deepestCause.prependMessage(messageFormat, parameters);
}
return new ExecutionException(cause, messageFormat, parameters);
}