Currently it is not possible to attach reports to an error via the section trait as the Section::error() method takes a type that must implement Error which Report does not. Since it's not possible to implement Error for Report, are there any plans of adding Section::report_error() or something similar to support that use-case?
For example, this doesn't work:
let results: Vec<Result<(), Report>> = job();
let errors = results.into_iter().filter_map(|res| match res {
Ok(()) => None,
Err(e) => Some(e),
}).collect::<Vec<Report>>();
if errors.is_empty() {
return Ok(());
}
let error = errors.into_iter().fold(
eyre!("{} jobs have finished with an error", errors.len()),
|acc, err| acc.error(err),
);
Err(error)
Currently it is not possible to attach reports to an error via the section trait as the Section::error() method takes a type that must implement Error which Report does not. Since it's not possible to implement Error for Report, are there any plans of adding Section::report_error() or something similar to support that use-case?
For example, this doesn't work: