Properly throw CannotDecrypt exception with error message

This commit is contained in:
Paul Schaub 2022-11-06 14:41:37 +01:00
parent e75dde1637
commit c32ef9830b
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
4 changed files with 13 additions and 0 deletions

View file

@ -106,6 +106,9 @@ public class DecryptCmd extends AbstractSopCmd {
} catch (SOPGPException.BadData badData) {
String errorMsg = getMsg("sop.error.input.stdin_not_a_message");
throw new SOPGPException.BadData(errorMsg, badData);
} catch (SOPGPException.CannotDecrypt e) {
String errorMsg = getMsg("sop.error.runtime.cannot_decrypt_message");
throw new SOPGPException.CannotDecrypt(errorMsg, e);
} catch (IOException ioException) {
throw new RuntimeException(ioException);
}