Skip to main content

error_chain_with_limit_and

Function error_chain_with_limit_and 

pub fn error_chain_with_limit_and<'a, F>(
    error: &'a (dyn Error + 'static),
    max_depth: usize,
    next_source: F,
) -> impl Iterator<Item = &'a (dyn Error + 'static)>
where F: FnMut(&'a (dyn Error + 'static)) -> Option<&'a (dyn Error + 'static)>,
Expand description

Iterate over an error and custom successors, visiting at most max_depth errors.

The supplied error counts toward the limit. The callback is never called for a zero or one-item limit. Otherwise this behaves like error_chain_with, with an explicit traversal bound that also limits cycles from the callback.