From 477e6516ed7e13b2592a94d29a0f65ca60c3a78f Mon Sep 17 00:00:00 2001 From: AsamK Date: Mon, 16 May 2022 12:23:45 +0200 Subject: [PATCH] Prevent printing stack trace for unregistered users --- .../org/asamk/signal/manager/helper/RecipientHelper.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 82368ca2..15508cd4 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 @@ -51,7 +51,11 @@ public class RecipientHelper { final ACI aci; try { aci = getRegisteredUser(number); - } catch (UnregisteredRecipientException | IOException e) { + } catch (UnregisteredRecipientException e) { + logger.warn("Failed to get uuid for e164 number: {}", number); + // Return SignalServiceAddress with unknown UUID + return address.toSignalServiceAddress(); + } catch (IOException e) { logger.warn("Failed to get uuid for e164 number: {}", number, e); // Return SignalServiceAddress with unknown UUID return address.toSignalServiceAddress(); @@ -106,7 +110,8 @@ public class RecipientHelper { .getRegisteredUsers(ServiceConfig.getIasKeyStore(), numbers, serviceEnvironmentConfig.getCdsMrenclave()); - } catch (Quote.InvalidQuoteFormatException | UnauthenticatedQuoteException | SignatureException | UnauthenticatedResponseException | InvalidKeyException | NumberFormatException e) { + } catch (Quote.InvalidQuoteFormatException | UnauthenticatedQuoteException | SignatureException | + UnauthenticatedResponseException | InvalidKeyException | NumberFormatException e) { throw new IOException(e); } -- 2.50.1