summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-05 16:36:00 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-03-09 11:52:38 +0100
commit0a64f6eaa56a9762810b282f4073db3a2fe2fe7d (patch)
treecebe1d6afbb092322f378e22d4a197e7974e2483 /core
parent247c0afa9af65d5ba357f77feac2229b3db5983e (diff)
core: Define core::Error using thiserror.
Diffstat (limited to 'core')
-rw-r--r--core/Cargo.toml1
-rw-r--r--core/src/lib.rs8
2 files changed, 5 insertions, 4 deletions
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. */