Exception handling: Handle CompletionException like ExecutionException

This commit is contained in:
JOO200
2020-01-05 16:13:38 +01:00
committed by Daniel Ennis
parent f2f37a3954
commit eb7064f7c4
@@ -47,6 +47,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
@@ -171,7 +172,7 @@ public class RegisteredCommand<CEC extends CommandExecutionContext<CEC, ? extend
}
void handleException(CommandIssuer sender, List<String> args, Throwable e) {
while (e instanceof ExecutionException) {
while (e instanceof ExecutionException || e instanceof CompletionException) {
e = e.getCause();
}
if (e instanceof InvocationTargetException && e.getCause() instanceof InvalidCommandArgument) {