EngineHub / Piston

A generic command system, with tie-ins to many Minecraft platforms such as Bukkit, Forge, and Sponge.
GNU General Public License v3.0
17 stars 3 forks source link

Parse exceptions thrown before checking conditions #8

Closed wizjany closed 5 years ago

wizjany commented 5 years ago

In CommandManager#execute: https://github.com/EngineHub/Piston/blob/v0.3.0/core/src/main/java/org/enginehub/piston/CommandManager.java#L145-L146

If the parse call throws an exception anywhere, the parse exception will propagate, so any potentially known commands with permission conditions won't get checked.

This means that the end user sees this: instead of this:

It would likely be necessary to allow parse to return partial results to verify, or for parse to validate conditions while parsing (which is probably out-of-scope for a parser).