mojira.dev
MC-121662

Unhandled exceptions in commands just dump the exception into chat, without the "unknown error" message

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:

  1. 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)

  2. -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).

Linked issues

Comments

AgentM

also take a look at MC-121913 related to logging and clogging up the log folder with tons of error messages. filling up the disk.

[Mod]Les3awe

This issue blocks MC-110532.

pokechu22

Nathan Adams

Confirmed

command, command-feedback, exception

Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w49a, Minecraft 17w49b, Minecraft 17w50a, Minecraft 18w01a

Minecraft 18w02a

Retrieved