error if age key cannot be decoded

This commit is contained in:
Jörg Thalheim 2023-11-30 10:49:55 +01:00
parent 3ae1c9cf75
commit d0362bb757

View File

@ -23,7 +23,9 @@ class SopsKey:
def get_public_key(privkey: str) -> str:
cmd = nix_shell(["age"], ["age-keygen", "-y"])
try:
res = subprocess.run(cmd, input=privkey, stdout=subprocess.PIPE, text=True)
res = subprocess.run(
cmd, input=privkey, stdout=subprocess.PIPE, text=True, check=True
)
except subprocess.CalledProcessError as e:
raise ClanError(
"Failed to get public key for age private key. Is the key malformed?"