Skip to main content

find_cause

Function find_cause 

Source
pub fn find_cause<'a, T: Error + 'static>(
    err: &'a (dyn Error + 'static),
) -> Option<&'a T>
Expand description

Walk an error’s source() chain to find a cause of type T.

Starts with the error itself, then follows source() links. Returns the first match.

Prefer CodecErrorExt methods for common types. Use this for codec-specific error types not covered by the extension trait.