Prevent printing stack trace for unregistered users

This commit is contained in:
AsamK 2022-05-16 12:23:45 +02:00
parent 22add1cbee
commit 477e6516ed

View file

@ -51,7 +51,11 @@ public class RecipientHelper {
final ACI aci; final ACI aci;
try { try {
aci = getRegisteredUser(number); 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); logger.warn("Failed to get uuid for e164 number: {}", number, e);
// Return SignalServiceAddress with unknown UUID // Return SignalServiceAddress with unknown UUID
return address.toSignalServiceAddress(); return address.toSignalServiceAddress();
@ -106,7 +110,8 @@ public class RecipientHelper {
.getRegisteredUsers(ServiceConfig.getIasKeyStore(), .getRegisteredUsers(ServiceConfig.getIasKeyStore(),
numbers, numbers,
serviceEnvironmentConfig.getCdsMrenclave()); serviceEnvironmentConfig.getCdsMrenclave());
} catch (Quote.InvalidQuoteFormatException | UnauthenticatedQuoteException | SignatureException | UnauthenticatedResponseException | InvalidKeyException | NumberFormatException e) { } catch (Quote.InvalidQuoteFormatException | UnauthenticatedQuoteException | SignatureException |
UnauthenticatedResponseException | InvalidKeyException | NumberFormatException e) {
throw new IOException(e); throw new IOException(e);
} }