From 4e1a2555be7ff1e6960714ee7fbabc13fa25d4c2 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 25 Jun 2025 22:42:38 +0200 Subject: [PATCH] Update try catch for command handling Fixes #12729 --- .../sources/net/minecraft/commands/Commands.java.patch | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/commands/Commands.java.patch b/paper-server/patches/sources/net/minecraft/commands/Commands.java.patch index 1910b261ab4..b430d59a445 100644 --- a/paper-server/patches/sources/net/minecraft/commands/Commands.java.patch +++ b/paper-server/patches/sources/net/minecraft/commands/Commands.java.patch @@ -76,11 +76,15 @@ CommandSourceStack commandSourceStack = parseResults.getContext().getSource(); Profiler.get().push(() -> "/" + command); ContextChain contextChain = finishParsing(parseResults, command, commandSourceStack); -@@ -313,9 +_,10 @@ +@@ -312,10 +_,13 @@ + ) ); } - } catch (Exception var12) { -+ if (throwCommandError) throw var12; // Paper +- } catch (Exception var12) { ++ // Paper start ++ } catch (Throwable var12) { // always gracefully handle it, no matter how bad:tm: ++ if (throwCommandError) throw var12; // rethrow directly if requested ++ // Paper end MutableComponent mutableComponent = Component.literal(var12.getMessage() == null ? var12.getClass().getName() : var12.getMessage()); - if (LOGGER.isDebugEnabled()) { - LOGGER.error("Command exception: /{}", command, var12);