]> nmode's Git Repositories - signal-cli/commitdiff
Prevent printing stack trace for unregistered users
authorAsamK <asamk@gmx.de>
Mon, 16 May 2022 10:23:45 +0000 (12:23 +0200)
committerAsamK <asamk@gmx.de>
Mon, 16 May 2022 10:27:43 +0000 (12:27 +0200)
lib/src/main/java/org/asamk/signal/manager/helper/RecipientHelper.java

index 82368ca23acca811c04cf5b9d33becf205f23d43..15508cd483f6cc23af54abc8b19acb72e2463a25 100644 (file)
@@ -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);
         }