]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java
Move all dbus interaction to dbus package
[signal-cli] / src / main / java / org / asamk / signal / dbus / DbusManagerImpl.java
index cd6c67150bd260a2377273cd483ac10b066b9058..ea09dba4a9b40e9366829fa45a5438d76650794e 100644 (file)
@@ -50,6 +50,7 @@ import org.freedesktop.dbus.DBusMap;
 import org.freedesktop.dbus.DBusPath;
 import org.freedesktop.dbus.connections.impl.DBusConnection;
 import org.freedesktop.dbus.exceptions.DBusException;
+import org.freedesktop.dbus.exceptions.DBusExecutionException;
 import org.freedesktop.dbus.interfaces.DBusInterface;
 import org.freedesktop.dbus.interfaces.DBusSigHandler;
 import org.freedesktop.dbus.types.Variant;
@@ -342,8 +343,13 @@ public class DbusManagerImpl implements Manager {
 
     @Override
     public Pair<GroupId, SendGroupMessageResults> joinGroup(final GroupInviteLinkUrl inviteLinkUrl) throws IOException, InactiveGroupLinkException {
-        final var newGroupId = signal.joinGroup(inviteLinkUrl.getUrl());
-        return new Pair<>(GroupId.unknownVersion(newGroupId), new SendGroupMessageResults(0, List.of()));
+        try {
+            final var newGroupId = signal.joinGroup(inviteLinkUrl.getUrl());
+            return new Pair<>(GroupId.unknownVersion(newGroupId), new SendGroupMessageResults(0, List.of()));
+        } catch (DBusExecutionException e) {
+            throw new IOException("Failed to join group: " + e.getMessage() + " (" + e.getClass().getSimpleName() + ")",
+                    e);
+        }
     }
 
     @Override