From 2217dbe2124ca4b766b5348b37851afaa60e1170 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 2 Dec 2013 15:43:55 -0600 Subject: [PATCH] Catch all exceptions in jansi initialization. Fixes BUKKIT-4936 Both log4j and our own jline/jansi initialization attempt to catch errors caused by jansi's use of native libraries. However both of them use the Exception type which does not catch all errors. On Windows Server 2008 R2 Enterprise without installing extra software the required C++ libraries are not available which causes an error that does not extend Exception. To ensure we catch all errors I've changed both of these to catch Throwable instead which gets us a working console minus jansi functionality. By: Travis Watkins --- .../org/apache/logging/log4j/core/appender/ConsoleAppender.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java b/paper-server/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java index 5629e0b1d..341eaa334 100644 --- a/paper-server/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java +++ b/paper-server/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java @@ -130,7 +130,7 @@ public final class ConsoleAppender extends AbstractOutputStreamAppender { LOGGER.debug("Jansi is not installed, cannot find {}", JANSI_CLASS); } catch (final NoSuchMethodException nsme) { LOGGER.warn("{} is missing the proper constructor", JANSI_CLASS); - } catch (final Exception ex) { + } catch (final Throwable ex) { // CraftBukkit - Exception -> Throwable LOGGER.warn("Unable to instantiate {}", JANSI_CLASS); } return printStream;