From: AsamK Date: Sun, 23 Jan 2022 19:50:56 +0000 (+0100) Subject: Improve error handling of getUserStatus command for invalid phonen numbers X-Git-Tag: v0.10.3~14 X-Git-Url: https://git.nmode.ca/signal-cli/commitdiff_plain/5d23b1ed9d222a3741bebff67e4af9b901a21b0e?ds=sidebyside Improve error handling of getUserStatus command for invalid phonen numbers --- diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java index 5c4896e1..38acd37b 100644 --- a/lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java +++ b/lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java @@ -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); } diff --git a/src/main/java/org/asamk/signal/commands/GetUserStatusCommand.java b/src/main/java/org/asamk/signal/commands/GetUserStatusCommand.java index 50e9b17f..5ab237f9 100644 --- a/src/main/java/org/asamk/signal/commands/GetUserStatusCommand.java +++ b/src/main/java/org/asamk/signal/commands/GetUserStatusCommand.java @@ -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