mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-26 22:32:07 +01:00
toRecipients(): Throw IllegalArgumentException instead of IllegalStateException
This commit is contained in:
parent
4f0493bce7
commit
83362816d0
1 changed files with 4 additions and 4 deletions
|
@ -98,7 +98,7 @@ public class EncryptionBuilder implements EncryptionBuilderInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encryptionKeys.isEmpty()) {
|
if (encryptionKeys.isEmpty()) {
|
||||||
throw new IllegalStateException("No valid encryption keys found!");
|
throw new IllegalArgumentException("No valid encryption keys found!");
|
||||||
}
|
}
|
||||||
EncryptionBuilder.this.encryptionKeys.addAll(encryptionKeys);
|
EncryptionBuilder.this.encryptionKeys.addAll(encryptionKeys);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public class EncryptionBuilder implements EncryptionBuilderInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (encryptionKeys.isEmpty()) {
|
if (encryptionKeys.isEmpty()) {
|
||||||
throw new IllegalStateException("No valid encryption keys found!");
|
throw new IllegalArgumentException("No valid encryption keys found!");
|
||||||
}
|
}
|
||||||
EncryptionBuilder.this.encryptionKeys.addAll(encryptionKeys);
|
EncryptionBuilder.this.encryptionKeys.addAll(encryptionKeys);
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ public class EncryptionBuilder implements EncryptionBuilderInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encryptionKeys.isEmpty()) {
|
if (encryptionKeys.isEmpty()) {
|
||||||
throw new IllegalStateException("No valid encryption keys found!");
|
throw new IllegalArgumentException("No valid encryption keys found!");
|
||||||
}
|
}
|
||||||
|
|
||||||
EncryptionBuilder.this.encryptionKeys.addAll(encryptionKeys);
|
EncryptionBuilder.this.encryptionKeys.addAll(encryptionKeys);
|
||||||
|
@ -169,7 +169,7 @@ public class EncryptionBuilder implements EncryptionBuilderInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EncryptionBuilder.this.encryptionKeys.isEmpty()) {
|
if (EncryptionBuilder.this.encryptionKeys.isEmpty()) {
|
||||||
throw new IllegalStateException("No valid encryption keys found!");
|
throw new IllegalArgumentException("No valid encryption keys found!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new WithAlgorithmsImpl();
|
return new WithAlgorithmsImpl();
|
||||||
|
|
Loading…
Reference in a new issue