Fixed an issue where the ParametricCallable wasn't forwarding InvocationTargetExpections caused by CommandExceptions properly

Fixes WORLDEDIT-3364
This commit is contained in:
Wyatt Childers 2016-07-17 19:02:43 -04:00
parent c957ffb95a
commit b9801ebf57

View File

@ -240,6 +240,11 @@ public Object call(String stringArguments, CommandLocals locals, String[] parent
String name = parameter.getName();
throw new InvalidUsageException("For parameter '" + name + "': " + e.getMessage(), this);
} catch (InvocationTargetException e) {
if (e.getCause() instanceof CommandException) {
throw (CommandException) e.getCause();
}
throw new WrappedCommandException(e);
} catch (Throwable t) {
throw new WrappedCommandException(t);
}