From 9b7f4f4fb75a03f2e9b4877732d1e37ca0b0416d Mon Sep 17 00:00:00 2001 From: Davirain Date: Wed, 16 Nov 2022 02:51:43 +0800 Subject: [PATCH] Add other error item (#238) * Add Other Error Item * Create 237-add-othe-erorr-item.md * fmt code --- .changelog/unreleased/features/237-add-othe-erorr-item.md | 2 ++ crates/ibc/src/core/ics02_client/error.rs | 4 ++++ crates/ibc/src/core/ics03_connection/error.rs | 4 ++++ crates/ibc/src/core/ics04_channel/error.rs | 4 ++++ 4 files changed, 14 insertions(+) create mode 100644 .changelog/unreleased/features/237-add-othe-erorr-item.md diff --git a/.changelog/unreleased/features/237-add-othe-erorr-item.md b/.changelog/unreleased/features/237-add-othe-erorr-item.md new file mode 100644 index 000000000..fd31ec3dd --- /dev/null +++ b/.changelog/unreleased/features/237-add-othe-erorr-item.md @@ -0,0 +1,2 @@ +- Add Other Item for Ics02Client,Ics03connection, Ics04Channel Error + ([#237](https://github.com/cosmos/ibc-rs/issues/237)) \ No newline at end of file diff --git a/crates/ibc/src/core/ics02_client/error.rs b/crates/ibc/src/core/ics02_client/error.rs index efa610f11..b4e1dd105 100644 --- a/crates/ibc/src/core/ics02_client/error.rs +++ b/crates/ibc/src/core/ics02_client/error.rs @@ -272,5 +272,9 @@ define_error! { ClientSpecific { description: String } | e | { format_args!("client specific error: {0}", e.description) }, + + Other + { description: String } + | e| { format_args!("other error: {0}", e.description) }, } } diff --git a/crates/ibc/src/core/ics03_connection/error.rs b/crates/ibc/src/core/ics03_connection/error.rs index 909ff143d..6acd3921e 100644 --- a/crates/ibc/src/core/ics03_connection/error.rs +++ b/crates/ibc/src/core/ics03_connection/error.rs @@ -166,5 +166,9 @@ define_error! { reason: String, } | e | { format_args!("invalid client state: {0}", e.reason) }, + + Other + { description: String } + | e| { format_args!("other error: {0}", e.description) }, } } diff --git a/crates/ibc/src/core/ics04_channel/error.rs b/crates/ibc/src/core/ics04_channel/error.rs index 50e2b4c49..469fbf8c2 100644 --- a/crates/ibc/src/core/ics04_channel/error.rs +++ b/crates/ibc/src/core/ics04_channel/error.rs @@ -351,6 +351,10 @@ define_error! { AbciConversionFailed { abci_event: String } | e | { format_args!("Failed to convert abci event to IbcEvent: {}", e.abci_event)}, + + Other + { description: String } + | e| { format_args!("other error: {0}", e.description) }, } }