Affects Version/s: Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w49a, Minecraft 17w49b, Minecraft 17w50a, Minecraft 18w01a
Fix Version/s: Minecraft 18w02a
If a command has an unhandled exception, the exception's message is simply dumped into chat (e.g. java.util.NoSuchElementException) without any context,
and no stacktrace is printed in the server console. In prior versions, it would output An unknown error occurred while attempting to perform this command (commands.generic.exception).
This is problematic for 2 reasons:
- It's not clear to the user what went wrong - just that an exception of some sort was thrown (this is fine if the exception has a user-friendly message, but in these cases it doesn't since they're unexpected)
The lack of a stacktrace means that it's basically impossible to debug. No stacktrace on command-specific syntax exceptions is fine, but for other unexpected exceptions it's not (e.g. a NullPointerException - not knowing the line it occurred on makes it pretty much useless)
Reproduction is hard - but right now this can be reproduced through MC-121661 (running /help asdfasdfasdf), or through MC-106551 (how I first encountered it – not recommended for general testing though)
As of 17w45b, a stacktrace is now printed at level ERROR. However, this also isn't ideal, since this happens for brigadier exceptions too (which have the stacktrace disabled, but it implies something went wrong at a deeper level).