Unwraps InvocationTargetException (#315)

This exception is just a wrapper for the one thrown on invoked methods
This commit is contained in:
Edson Passos
2021-02-04 19:28:36 -03:00
committed by GitHub
parent 3dfee40c57
commit 91e720011e
@@ -171,10 +171,7 @@ public class RegisteredCommand<CEC extends CommandExecutionContext<CEC, ? extend
}
void handleException(CommandIssuer sender, List<String> args, Throwable e) {
while (e instanceof ExecutionException || e instanceof CompletionException) {
e = e.getCause();
}
if (e instanceof InvocationTargetException && e.getCause() instanceof InvalidCommandArgument) {
while (e instanceof ExecutionException || e instanceof CompletionException || e instanceof InvocationTargetException) {
e = e.getCause();
}
if (e instanceof ShowCommandHelp) {