summaryrefslogtreecommitdiffstats
path: root/store/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'store/src/lib.rs')
-rw-r--r--store/src/lib.rs25
1 files changed, 9 insertions, 16 deletions
diff --git a/store/src/lib.rs b/store/src/lib.rs
index 5a1ea2d9..b6046148 100644
--- a/store/src/lib.rs
+++ b/store/src/lib.rs
@@ -53,7 +53,6 @@
extern crate capnp;
#[macro_use]
extern crate capnp_rpc;
-#[macro_use]
extern crate failure;
extern crate futures;
extern crate rand;
@@ -1180,37 +1179,31 @@ impl From<node::Error> for failure::Error {
}
}
-#[derive(Fail, Debug)]
+#[derive(thiserror::Error, Debug)]
/// Errors returned from the store.
pub enum Error {
/// A requested key was not found.
- #[fail(display = "Key not found")]
+ #[error("Key not found")]
NotFound,
/// The new key is in conflict with the current key.
- #[fail(display = "New key conflicts with the current key")]
+ #[error("New key conflicts with the current key")]
Conflict,
/// This is a catch-all for unspecified backend errors, and should
/// go away soon.
- #[fail(display = "Unspecified store error")]
+ #[error("Unspecified store error")]
StoreError,
/// A protocol error occurred.
- #[fail(display = "Unspecified protocol error")]
+ #[error("Unspecified protocol error")]
ProtocolError,
/// A Cert is malformed.
- #[fail(display = "Malformed Cert")]
+ #[error("Malformed Cert")]
MalformedCert,
/// A fingerprint is malformed.
- #[fail(display = "Malformed fingerprint")]
+ #[error("Malformed fingerprint")]
MalformedFingerprint,
/// A `capnp::Error` occurred.
- #[fail(display = "Internal RPC error")]
- RpcError(capnp::Error),
-}
-
-impl From<capnp::Error> for Error {
- fn from(error: capnp::Error) -> Self {
- Error::RpcError(error)
- }
+ #[error("Internal RPC error")]
+ RpcError(#[from] capnp::Error),
}
impl From<capnp::NotInSchema> for Error {