From e297dfd3c1d286acec2925caee0d06d441a781d0 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 10 Jun 2021 15:04:08 +0200 Subject: [PATCH] EncryptionOptions: Consistent exceptions --- .../org/pgpainless/encryption_signing/EncryptionOptions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java index 7c8542a3..5d08ba65 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java +++ b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java @@ -146,7 +146,7 @@ public class EncryptionOptions { List 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) {