diff --git a/Cargo.lock b/Cargo.lock index fb41890be1..7042e76eb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,10 +207,10 @@ version = "0.1.0" dependencies = [ "aries-vcx", "derive_builder 0.11.2", - "failure", "log", "serde", "serde_json", + "thiserror", "uuid 1.2.1", ] @@ -1943,7 +1943,6 @@ dependencies = [ "chrono", "derive_builder 0.10.2", "env_logger", - "failure", "lazy_static", "libvdrtools", "log", @@ -1955,6 +1954,7 @@ dependencies = [ "serde_json", "strum", "strum_macros", + "thiserror", "time", "tokio", "url", @@ -3372,18 +3372,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", diff --git a/agents/rust/aries-vcx-agent/Cargo.toml b/agents/rust/aries-vcx-agent/Cargo.toml index 7e2d96b656..f82bd02945 100644 --- a/agents/rust/aries-vcx-agent/Cargo.toml +++ b/agents/rust/aries-vcx-agent/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.0" edition = "2021" [dependencies] -failure = "0.1.8" serde = "1.0.145" aries-vcx = { path = "../../../aries_vcx" } derive_builder = "0.11.2" serde_json = "1.0.85" log = "0.4.17" uuid = "1.2.1" +thiserror = "1.0.37" diff --git a/agents/rust/aries-vcx-agent/src/error/error_kind.rs b/agents/rust/aries-vcx-agent/src/error/error_kind.rs index dc9c23852a..5a0f19a3a3 100644 --- a/agents/rust/aries-vcx-agent/src/error/error_kind.rs +++ b/agents/rust/aries-vcx-agent/src/error/error_kind.rs @@ -1,21 +1,19 @@ -use failure::Fail; - -#[derive(Copy, Clone, Eq, PartialEq, Debug, Fail)] +#[derive(Copy, Clone, Eq, PartialEq, Debug, thiserror::Error)] pub enum AgentErrorKind { - #[fail(display = "AriesVCX error")] + #[error("AriesVCX error")] GenericAriesVcxError, - #[fail(display = "Failed to get invite details")] + #[error("Failed to get invite details")] InviteDetails, - #[fail(display = "No object found with specified ID")] + #[error("No object found with specified ID")] NotFound, - #[fail(display = "Unable to lock storage")] + #[error("Unable to lock storage")] LockError, - #[fail(display = "Serialization error")] + #[error("Serialization error")] SerializationError, - #[fail(display = "Invalid arguments passed")] + #[error("Invalid arguments passed")] InvalidArguments, - #[fail(display = "Credential definition already exists on the ledger")] + #[error("Credential definition already exists on the ledger")] CredDefAlreadyCreated, - #[fail(display = "Mediated connections not configured")] + #[error("Mediated connections not configured")] MediatedConnectionServiceUnavailable, }