Print stack only when debug is enabled

This commit is contained in:
md_5 2014-04-16 10:00:53 +10:00
parent 4da2a9b07a
commit 90246b4c94

View File

@ -1,18 +1,18 @@
From 3156688e2c385be10ce1971474b4378c4e3e5d0f Mon Sep 17 00:00:00 2001 From 1a678d0c1e635bdb4e25f9b59488d1e094c33089 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net> From: md_5 <git@md-5.net>
Date: Sun, 13 Apr 2014 09:00:59 +1000 Date: Sun, 13 Apr 2014 09:00:59 +1000
Subject: [PATCH] Print Stack on InternalException Subject: [PATCH] Print Stack on InternalException
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 8514dd6..8825258 100644 index 8514dd6..6321eac 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java --- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -85,6 +85,7 @@ public class NetworkManager extends SimpleChannelInboundHandler { @@ -85,6 +85,7 @@ public class NetworkManager extends SimpleChannelInboundHandler {
public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) { public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) {
this.close(new ChatMessage("disconnect.genericReason", new Object[] { "Internal Exception: " + throwable})); this.close(new ChatMessage("disconnect.genericReason", new Object[] { "Internal Exception: " + throwable}));
+ throwable.printStackTrace(); // Spigot + if (MinecraftServer.getServer().isDebugging()) throwable.printStackTrace(); // Spigot
} }
protected void a(ChannelHandlerContext channelhandlercontext, Packet packet) { protected void a(ChannelHandlerContext channelhandlercontext, Packet packet) {