From 373f7b0ae754797c851090e8502ecf51799089f1 Mon Sep 17 00:00:00 2001 From: Marcel Konrad Date: Fri, 26 Apr 2019 17:05:31 +0200 Subject: [PATCH] Improve exception logging --- .../exopandora/worldhandler/helper/ActionHelper.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/exopandora/worldhandler/helper/ActionHelper.java b/src/main/java/exopandora/worldhandler/helper/ActionHelper.java index 20e8518..f2cb70b 100644 --- a/src/main/java/exopandora/worldhandler/helper/ActionHelper.java +++ b/src/main/java/exopandora/worldhandler/helper/ActionHelper.java @@ -3,6 +3,7 @@ package exopandora.worldhandler.helper; import com.mojang.realmsclient.gui.ChatFormatting; import exopandora.worldhandler.Main; +import exopandora.worldhandler.WorldHandler; import exopandora.worldhandler.builder.impl.BuilderDifficulty; import exopandora.worldhandler.builder.impl.BuilderDifficulty.EnumDifficulty; import exopandora.worldhandler.builder.impl.BuilderGamemode; @@ -47,14 +48,7 @@ public class ActionHelper public static void changeTab(Content content, int index) { - try - { - Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(content.getCategory().getContent(index))); - } - catch(Exception e) - { - e.printStackTrace(); - } + ActionHelper.tryRun(() -> Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(content.getCategory().getContent(index)))); } public static void timeDawn() @@ -153,7 +147,7 @@ public class ActionHelper message.setStyle(new Style().setColor(net.minecraft.util.text.TextFormatting.RED)); Minecraft.getInstance().ingameGUI.addChatMessage(ChatType.SYSTEM, message); - e.printStackTrace(); + WorldHandler.LOGGER.throwing(e); } }