NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.22k stars 1.38k forks source link

Error printing for Hardhat v3 #5455

Closed schaable closed 3 months ago

schaable commented 3 months ago

Errors are formatted and printed based on their category. Errors may belong to one of these categories:

1. Hardhat errors: these are thrown from core or hardhat packages. 2. Hardhat plugin errors: these are thrown from official Hardhat plugins, such as hardhat-ignition. Technically, this category would also include built-in plugins like run, but since we’re not adding the pluginId property to their descriptors, they fall into category 1 (Hardhat errors). 3. Hardhat community plugin errors: these are thrown from community-developed plugins that use the HardhatPluginError, such as hardhat-deploy. 4. Other errors: this category includes any other errors that don't fall into the above categories. This includes instances of Error, as well as objects or strings.

Doc: https://www.notion.so/nomicfoundation/Design-doc-for-error-messages-2d49562c43de497d8241d8b024fe83b2#851e84f778c04437a5953c5f98a0b6d6

Screenshots: (ignore the Time to run the task.. messages)

Hardhat errors: hardhat-core

Hardhat plugin errors (added pluginId to the run descriptor, as we don't have any): hardhat-plugin

Hardhat community plugin errors: community-plugin

Other errors (Error instance and object): unexpected-error unknown-error

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 5:15pm
changeset-bot[bot] commented 3 months ago

⚠️ No Changeset found

Latest commit: fca90009231c0f89fac16edb90e2c7570401503c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR