]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java
Update libsignal-service-java
[signal-cli] / src / main / java / org / asamk / signal / dbus / DbusSignalImpl.java
index 392b2df02a78f33a0d94803695e259e8cad3fbde..0bb0c43534c33cab1b1101322da8b7dc8e4af2a1 100644 (file)
@@ -21,6 +21,7 @@ import org.whispersystems.libsignal.util.Pair;
 import org.whispersystems.libsignal.util.guava.Optional;
 import org.whispersystems.signalservice.api.groupsv2.GroupLinkNotActiveException;
 import org.whispersystems.signalservice.api.messages.SendMessageResult;
+import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
 import org.whispersystems.signalservice.api.util.InvalidNumberException;
 
 import java.io.File;
@@ -244,6 +245,8 @@ public class DbusSignalImpl implements Signal {
             m.setContactName(getSingleRecipientIdentifier(number, m.getUsername()), name);
         } catch (NotMasterDeviceException e) {
             throw new Error.Failure("This command doesn't work on linked devices.");
+        } catch (UnregisteredUserException e) {
+            throw new Error.Failure("Contact is not registered.");
         }
     }
 
@@ -253,6 +256,8 @@ public class DbusSignalImpl implements Signal {
             m.setContactBlocked(getSingleRecipientIdentifier(number, m.getUsername()), blocked);
         } catch (NotMasterDeviceException e) {
             throw new Error.Failure("This command doesn't work on linked devices.");
+        } catch (IOException e) {
+            throw new Error.Failure(e.getMessage());
         }
     }
 
@@ -262,6 +267,8 @@ public class DbusSignalImpl implements Signal {
             m.setGroupBlocked(getGroupId(groupId), blocked);
         } catch (GroupNotFoundException e) {
             throw new Error.GroupNotFound(e.getMessage());
+        } catch (IOException e) {
+            throw new Error.Failure(e.getMessage());
         }
     }