]> nmode's Git Repositories - signal-cli/commitdiff
Print exception name when failing to load state fiel
authorAsamK <asamk@gmx.de>
Sat, 27 Feb 2021 16:43:19 +0000 (17:43 +0100)
committerAsamK <asamk@gmx.de>
Sat, 27 Feb 2021 16:44:33 +0000 (17:44 +0100)
src/main/java/org/asamk/signal/App.java

index 5b2c91c6a2faca1d56478f8bca6313b73c3ea746..75ac5280e05f873a36307796e525e7b92f2e1fa9 100644 (file)
@@ -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 {