mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 08:57:35 +01:00
Always show command exception stack traces in logs (#10766)
This commit is contained in:
parent
d3ffa62b7f
commit
b14958485d
@ -2021,7 +2021,7 @@ index e6c7f62ed379a78645933670299e4fcda8540ed1..59d7e8a3d83d3ab7aa28606401bb129c
|
|||||||
public org.bukkit.command.CommandSender getBukkitSender() {
|
public org.bukkit.command.CommandSender getBukkitSender() {
|
||||||
return this.source.getBukkitSender(this);
|
return this.source.getBukkitSender(this);
|
||||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||||
index aa2fca6917fb67fe0e9ba067d11487c3a274f675..24086a82e1687cb1925398218b18c2384fa8f6e3 100644
|
index aa2fca6917fb67fe0e9ba067d11487c3a274f675..86af3494f3d86c7b9fb90ce5a877ec23f5a79e7f 100644
|
||||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||||
@@ -156,7 +156,7 @@ public class Commands {
|
@@ -156,7 +156,7 @@ public class Commands {
|
||||||
@ -2069,14 +2069,19 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..24086a82e1687cb1925398218b18c238
|
|||||||
CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource();
|
CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource();
|
||||||
|
|
||||||
commandlistenerwrapper.getServer().getProfiler().push(() -> {
|
commandlistenerwrapper.getServer().getProfiler().push(() -> {
|
||||||
@@ -339,6 +351,7 @@ public class Commands {
|
@@ -339,10 +351,11 @@ public class Commands {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
+ if (throwCommandError) throw exception;
|
+ if (throwCommandError) throw exception;
|
||||||
MutableComponent ichatmutablecomponent = Component.literal(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage());
|
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
|
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) {
|
||||||
@@ -477,7 +490,7 @@ public class Commands {
|
@@ -477,7 +490,7 @@ public class Commands {
|
||||||
Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
|
Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
|
||||||
RootCommandNode vanillaRoot = new RootCommandNode();
|
RootCommandNode vanillaRoot = new RootCommandNode();
|
||||||
|
Loading…
Reference in New Issue
Block a user