summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock1
-rw-r--r--core/Cargo.toml1
-rw-r--r--core/src/lib.rs8
3 files changed, 6 insertions, 4 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 26e7b055..eb0cd5b0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1562,6 +1562,7 @@ dependencies = [
"dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 71a40247..d6a95c53 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -24,3 +24,4 @@ maintenance = { status = "actively-developed" }
dirs = "2.0"
failure = "0.1.2"
tempfile = "3.1"
+thiserror = "1"
diff --git a/core/src/lib.rs b/core/src/lib.rs
index 1fda8453..aa6ba30d 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -268,16 +268,16 @@ impl Config {
/// Result type for Sequoia.
pub type Result<T> = ::std::result::Result<T, failure::Error>;
-#[derive(Fail, Debug)]
+#[derive(thiserror::Error, Debug)]
/// Errors for Sequoia.
pub enum Error {
/// The network policy was violated by the given action.
- #[fail(display = "Unmet network policy requirement: {}", _0)]
+ #[error("Unmet network policy requirement: {0}")]
NetworkPolicyViolation(NetworkPolicy),
/// An `io::Error` occurred.
- #[fail(display = "{}", _0)]
- IoError(#[cause] io::Error),
+ #[error("{0}")]
+ IoError(#[from] io::Error),
}
/* Network policy. */