Skip to main content

error_chain_root

Function error_chain_root 

Source
fn error_chain_root(err: &dyn Error) -> &dyn Error
Expand description

Returns the root cause of an error’s source chain, i.e. the last error reachable via std::error::Error::source. For an error without any source the error itself is returned.

Mirrors err.sources().last().unwrap() (unstable error_iter, which yields the error itself followed by its sources).