Fixed handling of CommandExceptions thrown by commands.

This commit is contained in:
sk89q 2011-02-25 08:59:10 -08:00
parent 0ffe0689d1
commit c58f8f4155

View File

@ -346,6 +346,10 @@ public abstract class CommandsManager<T> {
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
e.printStackTrace(); e.printStackTrace();
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
if (e.getCause() instanceof CommandException) {
throw (CommandException) e.getCause();
}
throw new WrappedCommandException(e.getCause()); throw new WrappedCommandException(e.getCause());
} }
} }