diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-03-09 11:42:45 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-03-09 18:09:50 +0100 |
commit | 391a4b92c977cd64dfd131f3e29b0bc8d756d064 (patch) | |
tree | b5b96ff935853cef9ee22e01890c248a791e724e /ffi/src/error.rs | |
parent | 58d662c6d37dd1b0dccd4d0ce30290b8ede408e9 (diff) |
Switch from failure to anyhow.
- Use the anyhow crate instead of failure to implement the dynamic
side of our error handling. anyhow::Error derefs to dyn
std::error::Error, allowing better interoperability with other
stdlib-based error handling libraries.
- Fixes #444.
Diffstat (limited to 'ffi/src/error.rs')
-rw-r--r-- | ffi/src/error.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ffi/src/error.rs b/ffi/src/error.rs index 331bad04..26940111 100644 --- a/ffi/src/error.rs +++ b/ffi/src/error.rs @@ -1,6 +1,5 @@ //! Maps various errors to status codes. -use failure; use std::io; extern crate sequoia_openpgp as openpgp; @@ -10,11 +9,11 @@ pub use crate::openpgp::error::Status; pub(crate) use crate::openpgp::error::Error; trait FromSequoiaError<'a> { - fn from_sequoia_error(_: &'a failure::Error) -> Status; + fn from_sequoia_error(_: &'a anyhow::Error) -> Status; } impl<'a> FromSequoiaError<'a> for Status { - fn from_sequoia_error(e: &'a failure::Error) -> Self { + fn from_sequoia_error(e: &'a anyhow::Error) -> Self { if let Some(e) = e.downcast_ref::<core::Error>() { return match e { &core::Error::NetworkPolicyViolation(_) => |