1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-25 21:14:49 +02:00

EncryptionOptions: Consistent exceptions

This commit is contained in:
Paul Schaub 2021-06-10 15:04:08 +02:00
parent 512825aad4
commit e297dfd3c1
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -146,7 +146,7 @@ public class EncryptionOptions {
List<PGPPublicKey> encryptionSubkeys = encryptionKeySelectionStrategy
.selectEncryptionSubkeys(info.getEncryptionSubkeys(userId, purpose));
if (encryptionSubkeys.isEmpty()) {
throw new AssertionError("Key has no suitable encryption subkeys.");
throw new IllegalArgumentException("Key has no suitable encryption subkeys.");
}
for (PGPPublicKey encryptionSubkey : encryptionSubkeys) {