From dd7ef574e84ca6c1a548422904c6865048ae8e30 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 18 Apr 2020 01:30:07 -0400 Subject: implement editing a string in a text editor --- src/error.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 71c8285..8c253c9 100644 --- a/src/error.rs +++ b/src/error.rs @@ -9,9 +9,19 @@ pub enum Error { #[snafu(display("failed to decrypt: {}", source))] Decrypt { source: block_modes::BlockModeError }, - #[snafu(display("failed to parse pinentry output ({:?})", out,))] + #[snafu(display("failed to parse pinentry output ({:?})", out))] FailedToParsePinentry { out: String }, + #[snafu(display( + "failed to run editor {}: {:?}", + editor.to_string_lossy(), + res + ))] + FailedToRunEditor { + editor: std::path::PathBuf, + res: std::process::ExitStatus, + }, + // no Error impl // #[snafu(display("failed to expand with hkdf: {}", source))] // HkdfExpand { source: hkdf::InvalidLength }, @@ -30,6 +40,9 @@ pub enum Error { #[snafu(display("invalid cipherstring"))] InvalidCipherString, + #[snafu(display("invalid value for $EDITOR: {}", editor.to_string_lossy()))] + InvalidEditor { editor: std::ffi::OsString }, + #[snafu(display("invalid mac"))] InvalidMac, -- cgit v1.2.3-54-g00ecf