summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-05 16:36:46 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-03-09 11:52:38 +0100
commit5035966c2ed5da95740e9130e8c104221e51b87a (patch)
treeb36ab88ec686f6788b98d2e4cac7cbdf4e393054 /ipc
parent0a64f6eaa56a9762810b282f4073db3a2fe2fe7d (diff)
ipc: Define ipc's Errors using thiserror.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/Cargo.toml1
-rw-r--r--ipc/src/gnupg.rs8
-rw-r--r--ipc/src/lib.rs6
3 files changed, 8 insertions, 7 deletions
diff --git a/ipc/Cargo.toml b/ipc/Cargo.toml
index 35886f46..c38aa7bd 100644
--- a/ipc/Cargo.toml
+++ b/ipc/Cargo.toml
@@ -32,6 +32,7 @@ libc = "0.2.33"
memsec = "0.5.6"
rand = { version = "0.7", default-features = false }
tempfile = "3.0"
+thiserror = "1"
tokio = "0.1"
tokio-core = "0.1"
tokio-io = "0.1.4"
diff --git a/ipc/src/gnupg.rs b/ipc/src/gnupg.rs
index 79e2a862..ec308ca2 100644
--- a/ipc/src/gnupg.rs
+++ b/ipc/src/gnupg.rs
@@ -768,17 +768,17 @@ impl<'a> crypto::Decryptor for KeyPair<'a> {
}
-#[derive(Fail, Debug)]
+#[derive(thiserror::Error, Debug)]
/// Errors used in this module.
pub enum Error {
/// Errors related to `gpgconf`.
- #[fail(display = "gpgconf: {}", _0)]
+ #[error("gpgconf: {0}")]
GPGConf(String),
/// The remote operation failed.
- #[fail(display = "Operation failed: {}", _0)]
+ #[error("Operation failed: {0}")]
OperationFailed(String),
/// The remote party violated the protocol.
- #[fail(display = "Protocol violation: {}", _0)]
+ #[error("Protocol violation: {0}")]
ProtocolError(String),
}
diff --git a/ipc/src/lib.rs b/ipc/src/lib.rs
index cde5c3c3..9526c031 100644
--- a/ipc/src/lib.rs
+++ b/ipc/src/lib.rs
@@ -477,13 +477,13 @@ impl PartialEq for Cookie {
}
}
-#[derive(Fail, Debug)]
+#[derive(thiserror::Error, Debug)]
/// Errors returned from the network routines.
pub enum Error {
/// Handshake failed.
- #[fail(display = "Handshake failed: {}", _0)]
+ #[error("Handshake failed: {0}")]
HandshakeFailed(String),
/// Connection closed unexpectedly.
- #[fail(display = "Connection closed unexpectedly.")]
+ #[error("Connection closed unexpectedly.")]
ConnectionClosed(Vec<u8>),
}