Wrap and unwrap.

Exceptions are fun.
This commit is contained in:
wizjany 2019-05-29 21:38:31 -04:00
parent a29afe8cc1
commit 23ab79c999

View File

@ -223,7 +223,13 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
} catch (Throwable t) {
Throwable next = t;
do {
try {
WorldGuard.getInstance().getExceptionConverter().convert(next);
} catch (org.enginehub.piston.exception.CommandException pce) {
if (pce.getCause() instanceof CommandException) {
throw ((CommandException) pce.getCause());
}
}
next = next.getCause();
} while (next != null);