From 0c890c3a309da7219ff878fe9906a1e28b023299 Mon Sep 17 00:00:00 2001 From: HugoDaBosss Date: Tue, 8 Mar 2016 22:23:36 +0100 Subject: [PATCH] Print errors while in debug mode --- src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java b/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java index 658c4f82e..204b68ce0 100644 --- a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java +++ b/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java @@ -54,6 +54,8 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI { }).get(10, TimeUnit.SECONDS); } catch (Exception e) { System.out.println("Error fetching hand item: " + e.getClass().getName()); + if(ViaVersion.getInstance().isDebug()) + e.printStackTrace(); return null; } } @@ -214,8 +216,9 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI { f.get(10, TimeUnit.SECONDS); } } catch (Exception e) { - System.out.println("Failed to run task."); - e.printStackTrace(); + System.out.println("Failed to run task: " + e.getClass().getName()); + if(ViaVersion.getInstance().isDebug()) + e.printStackTrace(); } } }