]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/Main.java
Format timestamps
[signal-cli] / src / main / java / org / asamk / signal / Main.java
index fbdc0ce120410d0857f2d86d4fe4b3948c0cb21a..b2550fe75544771269c85e7301129b5c8ba8bc78 100644 (file)
@@ -110,7 +110,7 @@ public class Main {
                 ts = m;
                 if (m.userExists()) {
                     try {
-                        m.load();
+                        m.init();
                     } catch (Exception e) {
                         System.err.println("Error loading state file \"" + m.getFileName() + "\": " + e.getMessage());
                         return 2;
@@ -177,6 +177,9 @@ public class Main {
                     } catch (IOException e) {
                         System.err.println("Link request error: " + e.getMessage());
                         return 3;
+                    } catch (AssertionError e) {
+                        handleAssertionError(e);
+                        return 1;
                     } catch (InvalidKeyException e) {
                         e.printStackTrace();
                         return 2;
@@ -202,6 +205,9 @@ public class Main {
                     } catch (InvalidKeyException e) {
                         e.printStackTrace();
                         return 2;
+                    } catch (AssertionError e) {
+                        handleAssertionError(e);
+                        return 1;
                     } catch (URISyntaxException e) {
                         e.printStackTrace();
                         return 2;
@@ -221,8 +227,8 @@ public class Main {
                         for (DeviceInfo d : devices) {
                             System.out.println("Device " + d.getId() + (d.getId() == m.getDeviceId() ? " (this device)" : "") + ":");
                             System.out.println(" Name: " + d.getName());
-                            System.out.println(" Created: " + d.getCreated());
-                            System.out.println(" Last seen: " + d.getLastSeen());
+                            System.out.println(" Created: " + formatTimestamp(d.getCreated()));
+                            System.out.println(" Last seen: " + formatTimestamp(d.getLastSeen()));
                         }
                     } catch (IOException e) {
                         e.printStackTrace();