Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split expected and unexpected errors #757

Open
foresterre opened this issue Jul 24, 2023 · 0 comments
Open

Split expected and unexpected errors #757

foresterre opened this issue Jul 24, 2023 · 0 comments

Comments

@foresterre
Copy link
Owner

foresterre commented Jul 24, 2023

  • errors are reported twice in the E in Result<T, E> as well as via the Reporter?
    reporter.report_event(VerifyResult::incompatible(toolchain, error))?;
    Err(CargoMSRVError::SubCommandVerify(Error::VerifyFailed(
    VerifyFailed::from(rust_version),
    )))

The returned errors from the Result values, are instead used for expected and unexpected internal errors, although errors may bubble up, and can be reported in the end.

I intended to separate expected and unexpected errors from each other by reporting expected errors (e.g. when a toolchain of a certain version fails to compile a project), from unexpected errors, but there is room for improvement here.

Originally posted in #753 (comment)


  • Expected errors should be reported to the user via the reporter
  • expected errors can be converted from a Result Ei to a Ti where Ti From ; reporter.report(Ti)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant