diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index e891da2..839c37a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -19,6 +19,7 @@ use std::fmt; use std::io; +use std::path; use std::str; use std::string; @@ -47,6 +48,7 @@ pub enum Error { NitrokeyError(Option<&'static str>, nitrokey::Error), Utf8Error(str::Utf8Error), Error(String), + ExtensionFailed(path::PathBuf, Option<i32>), } impl TryInto<nitrokey::Error> for Error { @@ -113,6 +115,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 path, rc) => { + write!(f, "Extension {} failed", path.to_string_lossy())?; + if let Some(rc) = rc { + write!(f, " with exit code {}", rc)?; + } + Ok(()) + } } } } |