From 5b5da76bff414cda2cbbe3de611cd8ab77cd57a3 Mon Sep 17 00:00:00 2001 From: Gravita Date: Tue, 4 May 2021 19:39:10 +0700 Subject: [PATCH] [FIX] Crash corrupted sessions.json --- .../launchserver/auth/session/MemorySessionStorage.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/session/MemorySessionStorage.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/session/MemorySessionStorage.java index 86043483..0c636753 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/session/MemorySessionStorage.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/session/MemorySessionStorage.java @@ -102,8 +102,8 @@ public void dumpSessionsData() { Path path = Paths.get(dumpFile); try (Writer writer = IOHelper.newWriter(path)) { Launcher.gsonManager.gson.toJson(dumpedData, writer); - } catch (IOException e) { - logger.error(e); + } catch (Throwable e) { + logger.error("Sessions can't be saved", e); } } @@ -114,8 +114,8 @@ public void loadSessionsData() { DumpedData data = Launcher.gsonManager.gson.fromJson(reader, DumpedData.class); clientSet.putAll(data.clientSet); uuidIndex.putAll(data.uuidIndex); - } catch (IOException e) { - logger.error(e); + } catch (Throwable e) { + logger.error("Sessions can't be loaded", e); } }