Function combine_errors

Source
pub fn combine_errors<I, EIn, T>(results: I) -> Result<Vec<T>, BridgeError>
where I: IntoIterator<Item = Result<T, EIn>>, EIn: Display,
Expand description

Collects errors from an iterator of results and returns a combined error if any failed.

§Parameters

  • results: Iterator of results (errors should contain identifying information in their Debug representation)
  • prefix: Prefix message for the combined error (e.g., “Operator key collection failures”)

§Returns

  • Ok(Vec<T>) containing all successful results if all results are successful
  • Err(BridgeError) with a combined error message listing all failures