mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-11-30 01:06:50 +00:00
Use more appropriate exception types when catching accounts without phone numbers
This commit is contained in:
1 parent
bc7cd0cc95
commit
0786627bef
1 file changed
+1
-1
@@ -212,7 +212,7 @@ public class KeysGrpcService extends SimpleKeysGrpc.KeysImplBase {
|
||||
final IdentityKey identityKey = switch (identityType) {
|
||||
case ACI -> account.getAccountIdentityKey();
|
||||
case PNI -> account.getPhoneNumberIdentityKey()
|
||||
.orElseThrow(() -> new IllegalArgumentException("Account does not have a PNI identity key"));
|
||||
.orElseThrow(() -> GrpcExceptions.invalidArguments("account does not have a PNI identity key"));
|
||||
};
|
||||
|
||||
final UUID identifier = getIdentifier(account, identityType);
|
||||
|
||||
Reference in new issue
Block a user