diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2020-01-14 19:21:26 +0100 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-01-15 12:08:15 -0800 |
commit | 1e07212370806f3ea4ff7a6f66e5716b60ab1f77 (patch) | |
tree | c562f40b9888b9daf62a9d9a42eeef8bfa35413f /nitrokey/src/error.rs | |
parent | 5251aa2d1665ee12245d5d5fe09c1f207272978f (diff) | |
download | nitrocli-1e07212370806f3ea4ff7a6f66e5716b60ab1f77.tar.gz nitrocli-1e07212370806f3ea4ff7a6f66e5716b60ab1f77.tar.bz2 |
Bump nitrokey dependency to version 0.5.1
This change updates the version of the nitrokey crate that we use to
0.5.1. As part of that, it replaces occurrences of Storage::get_status
with Storage::get_storage_status as the method has been renamed.
Import subrepo nitrokey/:nitrokey at 817409140a8778215d2d65d614d3672166fff576
Diffstat (limited to 'nitrokey/src/error.rs')
-rw-r--r-- | nitrokey/src/error.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nitrokey/src/error.rs b/nitrokey/src/error.rs index 9e6adc0..f9af594 100644 --- a/nitrokey/src/error.rs +++ b/nitrokey/src/error.rs @@ -28,6 +28,8 @@ pub enum Error { UnexpectedError, /// An unknown error returned by libnitrokey. UnknownError(i64), + /// An error caused by a Nitrokey model that is not supported by this crate. + UnsupportedModelError, /// An error occurred when interpreting a UTF-8 string. Utf8Error(str::Utf8Error), } @@ -102,6 +104,7 @@ impl error::Error for Error { Error::RandError(ref err) => Some(err.as_ref()), Error::UnexpectedError => None, Error::UnknownError(_) => None, + Error::UnsupportedModelError => None, Error::Utf8Error(ref err) => Some(err), } } @@ -118,6 +121,7 @@ impl fmt::Display for Error { Error::RandError(ref err) => write!(f, "RNG error: {}", err), Error::UnexpectedError => write!(f, "An unexpected error occurred"), Error::UnknownError(ref err) => write!(f, "Unknown error: {}", err), + Error::UnsupportedModelError => write!(f, "Unsupported Nitrokey model"), Error::Utf8Error(ref err) => write!(f, "UTF-8 error: {}", err), } } |