Trait ethcore::error::ImportErrorResultExt
source · [−]pub trait ImportErrorResultExt<T> {
fn chain_err<F, EK>(self, callback: F) -> Result<T, ImportError>
where
F: FnOnce() -> EK,
EK: Into<ImportErrorKind>;
}Expand description
Additional methods for Result, for easy interaction with this crate.
Required methods
fn chain_err<F, EK>(self, callback: F) -> Result<T, ImportError> where
F: FnOnce() -> EK,
EK: Into<ImportErrorKind>,
fn chain_err<F, EK>(self, callback: F) -> Result<T, ImportError> where
F: FnOnce() -> EK,
EK: Into<ImportErrorKind>,
If the Result is an Err then chain_err evaluates the closure,
which returns some type that can be converted to ErrorKind, boxes
the original error to store as the cause, then returns a new error
containing the original error.