From 86711b0e5c37c7d202151c7d05b00e5bdeb7836b Mon Sep 17 00:00:00 2001 From: AsamK Date: Sat, 27 Feb 2021 17:43:19 +0100 Subject: [PATCH] Print exception name when failing to load state fiel --- src/main/java/org/asamk/signal/App.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/asamk/signal/App.java b/src/main/java/org/asamk/signal/App.java index 5b2c91c6..75ac5280 100644 --- a/src/main/java/org/asamk/signal/App.java +++ b/src/main/java/org/asamk/signal/App.java @@ -181,7 +181,11 @@ public class App { try { manager = RegistrationManager.init(username, dataPath, serviceEnvironment, BaseConfig.USER_AGENT); } catch (Throwable e) { - throw new UnexpectedErrorException("Error loading or creating state file: " + e.getMessage()); + throw new UnexpectedErrorException("Error loading or creating state file: " + + e.getMessage() + + " (" + + e.getClass().getSimpleName() + + ")"); } try (var m = manager) { command.handleCommand(ns, m); @@ -234,7 +238,13 @@ public class App { } catch (NotRegisteredException e) { throw new UserErrorException("User " + username + " is not registered."); } catch (Throwable e) { - throw new UnexpectedErrorException("Error loading state file for user " + username + ": " + e.getMessage()); + throw new UnexpectedErrorException("Error loading state file for user " + + username + + ": " + + e.getMessage() + + " (" + + e.getClass().getSimpleName() + + ")"); } try {