From 91e720011e4ec55583e2ff8a7be38c164f6119ad Mon Sep 17 00:00:00 2001 From: Edson Passos Date: Thu, 4 Feb 2021 19:28:36 -0300 Subject: [PATCH] Unwraps InvocationTargetException (#315) This exception is just a wrapper for the one thrown on invoked methods --- core/src/main/java/co/aikar/commands/RegisteredCommand.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/main/java/co/aikar/commands/RegisteredCommand.java b/core/src/main/java/co/aikar/commands/RegisteredCommand.java index 36b6799f..c84cef4b 100644 --- a/core/src/main/java/co/aikar/commands/RegisteredCommand.java +++ b/core/src/main/java/co/aikar/commands/RegisteredCommand.java @@ -171,10 +171,7 @@ public class RegisteredCommand 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) {