From c7e42591ddf31f0965c82fe8703a0ad1f38d963c Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 22 May 2024 10:24:09 -0700 Subject: [PATCH] Always show command exception stack traces in logs (#10766) --- patches/server/Brigadier-based-command-API.patch | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/patches/server/Brigadier-based-command-API.patch b/patches/server/Brigadier-based-command-API.patch index 006d5b07dc..79f4059072 100644 --- a/patches/server/Brigadier-based-command-API.patch +++ b/patches/server/Brigadier-based-command-API.patch @@ -2076,7 +2076,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (throwCommandError) throw exception; MutableComponent ichatmutablecomponent = Component.literal(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage()); ++ Commands.LOGGER.error("Command exception: /{}", s, exception); // Paper - always show execution exception in console log if (commandlistenerwrapper.getServer().isDebugging() || Commands.LOGGER.isDebugEnabled()) { // Paper - Debugging +- Commands.LOGGER.error("Command exception: /{}", s, exception); + StackTraceElement[] astacktraceelement = exception.getStackTrace(); + + for (int i = 0; i < Math.min(astacktraceelement.length, 3); ++i) { @@ -0,0 +0,0 @@ public class Commands { Map, CommandNode> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues RootCommandNode vanillaRoot = new RootCommandNode();