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 /store/src/macros.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 'store/src/macros.rs')
-rw-r--r-- | store/src/macros.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/store/src/macros.rs b/store/src/macros.rs index 11d5772b..7d69ff54 100644 --- a/store/src/macros.rs +++ b/store/src/macros.rs @@ -21,10 +21,10 @@ macro_rules! make_request { let r = match r { /* The Result. */ Which::Ok(Ok(x)) => Ok(x), - Which::Err(Ok(e)) => Err(failure::Error::from(e)), + Which::Err(Ok(e)) => Err(anyhow::Error::from(e)), /* Protocol violations. */ - Which::Ok(Err(e)) => Err(failure::Error::from(e)), - Which::Err(Err(e)) => Err(failure::Error::from(e)), + Which::Ok(Err(e)) => Err(anyhow::Error::from(e)), + Which::Err(Err(e)) => Err(anyhow::Error::from(e)), }; Promise::ok(r) })); @@ -43,10 +43,10 @@ macro_rules! make_request_map { let r = match r { /* The Result. */ Which::Ok(Ok(x)) => $map(x), - Which::Err(Ok(e)) => Err(failure::Error::from(e)), + Which::Err(Ok(e)) => Err(anyhow::Error::from(e)), /* Protocol violations. */ - Which::Ok(Err(e)) => Err(failure::Error::from(e)), - Which::Err(Err(e)) => Err(failure::Error::from(e)), + Which::Ok(Err(e)) => Err(anyhow::Error::from(e)), + Which::Err(Err(e)) => Err(anyhow::Error::from(e)), }; Promise::ok(r) })); |