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

Consider exposing CustomError #3480

Open
fvictorio opened this issue Dec 28, 2022 · 0 comments
Open

Consider exposing CustomError #3480

fvictorio opened this issue Dec 28, 2022 · 0 comments
Labels
status:needs-decision We need to make a decision about this type:chore A task related to code quality, tooling, CI, or anything that doesn't directly impact the end users

Comments

@fvictorio
Copy link
Member

As part of answering this issue, I created an example that makes the compile task fail if there are solc warnings.

The problem is this:

https://github.com/fvictorio/hardhat-examples/blob/2eb356307f92b58a5b6cd5ed9700bdb4ed4d3642/fail-on-warnings/hardhat.config.js#L14

This produces an ugly:

An unexpected error occurred:

Error: Compilation produced 1 warnings

which always includes the stack trace.

In theory you could use HardhatPluginError, but if this is a custom thing in your project, then it's not really a plugin. In this case, you need to add a dummy plugin name, which feels wrong.

We should consider exposing the CustomError class somewhere, or maybe some other class that extends from it.

@fvictorio fvictorio added the status:needs-decision We need to make a decision about this label Dec 28, 2022
@fvictorio fvictorio added the type:chore A task related to code quality, tooling, CI, or anything that doesn't directly impact the end users label Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-decision We need to make a decision about this type:chore A task related to code quality, tooling, CI, or anything that doesn't directly impact the end users
Projects
Status: No status
Development

No branches or pull requests

1 participant