Skip to main content

match_error_chain

Function match_error_chain 

Source
pub fn match_error_chain(
    err: &(dyn Error + 'static),
    match_set: &[ErrorType],
    exclude_set: &[ErrorType],
) -> bool
Expand description

Check whether an error chain contains a specific set of error types while not containing any of the excluded error types.

Walks the chain via source(), inspecting each error that can be downcast to DynamoError. Returns false immediately if any error’s type is in exclude_set. Otherwise, returns true if at least one error’s type is in match_set. Errors that are not DynamoError are skipped.