cosmos / ibc-rs

Rust implementation of the Inter-Blockchain Communication (IBC) protocol.
Apache License 2.0
181 stars 73 forks source link

Define an error type that captures all error variants shared between ibc-rs's errors #1249

Open seanchen1991 opened 4 weeks ago

seanchen1991 commented 4 weeks ago

This will serve to streamline and de-duplicate error variants shared amongst ibc-rs's different error types. @rnbguy suggestion is as follows:

pub enum GenericError<HostError> {
    HostError(HostError),
    DecodeError(..),
    EncodeError(..),
    ...
}

For example, any error related to decoding/encoding from any module would point to the GenericError::DecodeError variant. This should standardize error logging a bit, as well remove lots of extraneous variants that are copied between ibc-rs's different error types.