diff options
Diffstat (limited to 'nitrocli/src/error.rs')
-rw-r--r-- | nitrocli/src/error.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nitrocli/src/error.rs b/nitrocli/src/error.rs index 819bed8..1f6424e 100644 --- a/nitrocli/src/error.rs +++ b/nitrocli/src/error.rs @@ -45,6 +45,7 @@ pub enum Error { NitrokeyError(Option<&'static str>, nitrokey::Error), Utf8Error(str::Utf8Error), Error(String), + ExtensionFailed(String, Option<i32>), } impl TryInto<nitrokey::Error> for Error { @@ -99,6 +100,13 @@ impl fmt::Display for Error { Error::Utf8Error(_) => write!(f, "Encountered UTF-8 conversion error"), Error::IoError(ref e) => write!(f, "IO error: {}", e), Error::Error(ref e) => write!(f, "{}", e), + Error::ExtensionFailed(ref ext, rc) => { + write!(f, "Extension {} failed", ext)?; + if let Some(rc) = rc { + write!(f, " with exit code {}", rc)?; + } + Ok(()) + } } } } |