Fix concurrent cause of execution exception not being wrapped right
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
This commit is contained in:
parent
351951c196
commit
484c97ca98
1 changed files with 7 additions and 0 deletions
|
|
@ -118,6 +118,13 @@ public abstract class CommandExecutionCoordinator<C> {
|
||||||
if (this.getCommandTree().getCommandManager().postprocessContext(commandContext, command) == State.ACCEPTED) {
|
if (this.getCommandTree().getCommandManager().postprocessContext(commandContext, command) == State.ACCEPTED) {
|
||||||
try {
|
try {
|
||||||
command.getCommandExecutionHandler().executeFuture(commandContext).get();
|
command.getCommandExecutionHandler().executeFuture(commandContext).get();
|
||||||
|
} catch (final java.util.concurrent.ExecutionException exception) {
|
||||||
|
Throwable cause = exception.getCause();
|
||||||
|
if (cause instanceof CommandExecutionException) {
|
||||||
|
completableFuture.completeExceptionally(cause);
|
||||||
|
} else {
|
||||||
|
completableFuture.completeExceptionally(new CommandExecutionException(cause, commandContext));
|
||||||
|
}
|
||||||
} catch (final CommandExecutionException exception) {
|
} catch (final CommandExecutionException exception) {
|
||||||
completableFuture.completeExceptionally(exception);
|
completableFuture.completeExceptionally(exception);
|
||||||
} catch (final Exception exception) {
|
} catch (final Exception exception) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue