]> nmode's Git Repositories - signal-cli/commitdiff
Improve error handling of getUserStatus command for invalid phonen numbers
authorAsamK <asamk@gmx.de>
Sun, 23 Jan 2022 19:50:56 +0000 (20:50 +0100)
committerAsamK <asamk@gmx.de>
Sun, 23 Jan 2022 19:51:10 +0000 (20:51 +0100)
lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java
src/main/java/org/asamk/signal/commands/GetUserStatusCommand.java

index 5c4896e1f9be705567be2e617e4bd2d3f9e35fb7..38acd37b35cce55ae6671a7eea926e78e06aba53 100644 (file)
@@ -105,7 +105,7 @@ public class RecipientHelper {
                     .getRegisteredUsers(ServiceConfig.getIasKeyStore(),
                             numbers,
                             serviceEnvironmentConfig.getCdsMrenclave());
-        } catch (Quote.InvalidQuoteFormatException | UnauthenticatedQuoteException | SignatureException | UnauthenticatedResponseException | InvalidKeyException e) {
+        } catch (Quote.InvalidQuoteFormatException | UnauthenticatedQuoteException | SignatureException | UnauthenticatedResponseException | InvalidKeyException | NumberFormatException e) {
             throw new IOException(e);
         }
 
index 50e9b17f136a19ae3cdf07e06498519132ca590e..5ab237f9da59d1a6ecf93845f111fbb999035c60 100644 (file)
@@ -42,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