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

Improve error handling #286

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Commits on Jan 1, 2024

  1. Improve error handling

    * When a function already returns a `Result`, propagate errors
      instead of panicking with `expect`
    * For `NovaError::SynthesisError`, retain information about the
      original bellpepper error. Since `NovaError` implements `Clone`
      but bellpepper's `SynthesisError` does not, we keep the error
      information as a `String`.
    
    This commit only fixes low-hanging fruit in lib.rs, for functions
    that already return a `Result` and can easily propagate errors just
    by replacing `expect(...)` with `?`. There are still many `unwrap()`
    calls in functions returning `Result` in other modules, particularly
    gadgets. But I don't understand the code well in those parts, and I
    suspect some of those `unwrap()`s actually can't fail based on
    invariants of the code, so it makes perfect sense to leave them as is.
    jbearer committed Jan 1, 2024
    Configuration menu
    Copy the full SHA
    9e600d9 View commit details
    Browse the repository at this point in the history