]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/GetUserStatusCommand.java
Improve error handling of getUserStatus command for invalid phonen numbers
[signal-cli] / src / main / java / org / asamk / signal / commands / GetUserStatusCommand.java
index 97e4af340a1c091cb6dbaab87fa454161c7c34b8..5ab237f9da59d1a6ecf93845f111fbb999035c60 100644 (file)
@@ -17,7 +17,6 @@ import java.io.IOException;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.UUID;
-import java.util.stream.Collectors;
 
 public class GetUserStatusCommand implements JsonRpcLocalCommand {
 
@@ -43,7 +42,11 @@ public class GetUserStatusCommand implements JsonRpcLocalCommand {
         try {
             registered = m.areUsersRegistered(new HashSet<>(ns.getList("recipient")));
         } catch (IOException e) {
-            throw new IOErrorException("Unable to check if users are registered", e);
+            throw new IOErrorException("Unable to check if users are registered: "
+                    + e.getMessage()
+                    + " ("
+                    + e.getClass().getSimpleName()
+                    + ")", e);
         }
 
         // Output
@@ -53,7 +56,7 @@ public class GetUserStatusCommand implements JsonRpcLocalCommand {
                 final var number = entry.getValue().first();
                 final var uuid = entry.getValue().second();
                 return new JsonUserStatus(entry.getKey(), number, uuid == null ? null : uuid.toString(), uuid != null);
-            }).collect(Collectors.toList());
+            }).toList();
 
             jsonWriter.write(jsonUserStatuses);
         } else {