[][src]Function sonant::errors::iter_sources

Important traits for ErrorIter<'a>
pub fn iter_sources<E>(error: &E) -> ErrorIter where
    E: Error + 'static, 

Create an iterator over the chained error sources.

dyn Error iter_sources() is a nightly-only feature. Approximate it so we can build on stable.

use sonant::errors::iter_sources;

eprintln!("Error: {}", error);
for source in iter_sources(&error) {
    eprintln!("Caused by: {}", source);
}