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

chore: move printing errors to nargo_cli #1542

Closed
wants to merge 2 commits into from
Closed

chore: move printing errors to nargo_cli #1542

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 5, 2023

Description

Move printing errors to nargo_cli

Problem

Resolves #1530

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@ghost
Copy link
Author

ghost commented Jun 6, 2023

@kevaundray, what do you think about it?

@@ -45,7 +45,7 @@ pub(crate) enum CliError<B: Backend> {

/// Error while compiling Noir into ACIR.
#[error("Failed to compile circuit")]
CompilationError,
CompilationError(#[from] noirc_errors::Error),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work if a program returns more than one error?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be problems with this, but maybe we can go and do something like this:

TypeCheckError::Context { err: Box::new(self), ctx }

@phated
Copy link
Contributor

phated commented Jun 7, 2023

From the perspective of the LSP, this PR doesn't really provide the diagnostic information that is needed when a compilation fails.

@phated
Copy link
Contributor

phated commented Jun 7, 2023

@f01dab1e I think we're going to supersede this PR with #1598 since we need to get back a vector of diagnostics to use in the LSP. I was wondering if you could look into #1599 since you've been digging into this code and I took the quick-and-dirty route of adding the bad API 🙈

@ghost ghost closed this Jun 8, 2023
This pull request was closed.
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

Successfully merging this pull request may close these issues.

2 participants