-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Labels
A-color-eyreArea: color-eyre subcrateArea: color-eyre subcrateC-enhancementCategory: New feature or requestCategory: New feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
While with_error already allows attaching errors, a color_eyre::Report would need to be coerced into a StdError, losing HelpInfo sections, and probably also tracing data in the process.
eyre-rs/color-eyre#125 would have implemented the option to attach proper color_eyre::Reports, which would allow for something like this:
let mut errors = Vec::new();
for entry in walker {
if let Err(err) = do_stuff(entry) {
errors.push(err);
if params.fail_fast {
break;
}
}
}
if !errors.is_empty() {
let mut err = eyre::eyre!("Failed to do_stuff with {} errors", errors.len());
for e in errors {
err = err.report(e);
}
return Err(err);
}This would render nicely, with the full details for all errors, including helpful sections like from wrap_err or with_suggestion.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-color-eyreArea: color-eyre subcrateArea: color-eyre subcrateC-enhancementCategory: New feature or requestCategory: New feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed