]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/DaemonCommand.java
Refactor dbus client mode to improve maintainability
[signal-cli] / src / main / java / org / asamk / signal / commands / DaemonCommand.java
index 0591486c931f80b85450ae136fd74b24a6cbaeff..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);
         }
     }