]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/DaemonCommand.java
Refactor Manager interface
[signal-cli] / src / main / java / org / asamk / signal / commands / DaemonCommand.java
index 494892930eec05576c19d616e6e3360bc47fb1ae..9878de1595a5bd338ecb904ac27063cd51392114 100644 (file)
@@ -75,7 +75,7 @@ public class DaemonCommand implements MultiLocalCommand {
             }
         } catch (DBusException | IOException e) {
             logger.error("Dbus command failed", e);
-            throw new UnexpectedErrorException("Dbus command failed");
+            throw new UnexpectedErrorException("Dbus command failed", e);
         }
     }
 
@@ -95,7 +95,7 @@ public class DaemonCommand implements MultiLocalCommand {
         try (var conn = DBusConnection.getConnection(busType)) {
             final var signalControl = new DbusSignalControlImpl(c, m -> {
                 try {
-                    final var objectPath = DbusConfig.getObjectPath(m.getUsername());
+                    final var objectPath = DbusConfig.getObjectPath(m.getSelfNumber());
                     return run(conn, objectPath, m, outputWriter, ignoreAttachments);
                 } catch (DBusException e) {
                     logger.error("Failed to export object", e);
@@ -113,7 +113,7 @@ public class DaemonCommand implements MultiLocalCommand {
             signalControl.run();
         } catch (DBusException | IOException e) {
             logger.error("Dbus command failed", e);
-            throw new UnexpectedErrorException("Dbus command failed");
+            throw new UnexpectedErrorException("Dbus command failed", e);
         }
     }
 
@@ -134,8 +134,6 @@ public class DaemonCommand implements MultiLocalCommand {
                     break;
                 } catch (IOException e) {
                     logger.warn("Receiving messages failed, retrying", e);
-                } catch (InterruptedException ignored) {
-                    break;
                 }
             }
         });