From 391a4b92c977cd64dfd131f3e29b0bc8d756d064 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 9 Mar 2020 11:42:45 +0100 Subject: 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. --- ffi/src/error.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ffi/src/error.rs') 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::() { return match e { &core::Error::NetworkPolicyViolation(_) => -- cgit v1.2.3