PaperSpigot-Parent/CraftBukkit-Patches/0059-Log-Cause-of-Unexpected-Exceptions.patch

27 lines
1.1 KiB
Diff

From 2719f638dc995d03e1da40d1977ce0da149edfed Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 18 Dec 2013 13:39:14 +1100
Subject: [PATCH] Log Cause of Unexpected Exceptions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5c7c0d0..f95d560 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -546,6 +546,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
} catch (Throwable throwable) {
MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable);
+ // Spigot Start
+ if ( throwable.getCause() != null )
+ {
+ MinecraftServer.LOGGER.error( "\tCause of unexpected exception was", throwable.getCause() );
+ }
+ // Spigot End
CrashReport crashreport = null;
if (throwable instanceof ReportedException) {
--
2.1.4