mirror of
https://github.com/aikar/commands.git
synced 2026-06-12 02:50:37 +00:00
Unwraps InvocationTargetException (#315)
This exception is just a wrapper for the one thrown on invoked methods
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user