From d50c306e80d4e83d29c15aeb7abe23671e3d3ba4 Mon Sep 17 00:00:00 2001 From: Gravit Date: Sun, 15 Mar 2020 03:12:16 +0700 Subject: [PATCH] [FIX] MainClass error handling --- .../java/pro/gravit/launcher/client/ClientLauncher.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java index a432d646..d91eb126 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -34,10 +34,7 @@ import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; -import java.net.InetSocketAddress; -import java.net.ServerSocket; -import java.net.Socket; -import java.net.URL; +import java.net.*; import java.nio.file.FileVisitResult; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; @@ -302,6 +299,10 @@ private static void launch(ClientProfile profile, Params params) throws Throwabl // Invoke main method try { mainMethod.invokeWithArguments((Object) args.toArray(new String[0])); + LogHelper.debug("Main exit successful"); + } catch (Throwable e) { + LogHelper.error(e); + throw e; } finally { LauncherEngine.exitLauncher(0); }