replace throwing Error with RuntimeException

This commit is contained in:
woodser 2025-02-08 08:40:51 -05:00
parent afa95f1b15
commit 5f8cf97d16
2 changed files with 5 additions and 5 deletions

View file

@ -110,7 +110,7 @@ public final class KeyRing {
* @param password The password to unlock the keys or to generate new keys, nullable.
*/
public void generateKeys(String password) {
if (isUnlocked()) throw new Error("Current keyring must be closed to generate new keys");
if (isUnlocked()) throw new IllegalStateException("Current keyring must be closed to generate new keys");
symmetricKey = Encryption.generateSecretKey(256);
signatureKeyPair = Sig.generateKeyPair();
encryptionKeyPair = Encryption.generateKeyPair();