Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@nomicfoundation/hardhat-errors

NomicFoundation300.2kMIT3.0.2TypeScript support: included

The different errors that Hardhat can throw

ethereum, smart-contracts, hardhat

readme

hardhat-errors

⚠️ This package is an internal Hardhat component and it's not meant to be used directly.

This packages has the definition of the error classes used by Hardhat, and the list of possible errors.

This module exports:

  1. The error class HardhatError, which has a static field ERRORS, with the different ErrorDescriptors that it accepts.
  2. The error class HardhatPluginError, which is the recommended way to handle errors in Hardhat plugins. For convenience, it is re-exported from @nomicfoundation/hardhat/plugins. Plugin developers should import it from this path.
  3. The interface ErrorDescriptor.
  4. The assertion helper assertHardhatInvariant.

changelog

@nomicfoundation/hardhat-errors

3.0.2

Patch Changes

  • be469d6: Display an error message when attempting to use a global hardhat installation in a local repo (#5362)
  • 8d3b16c: Support for custom compilers (#7130)

3.0.1

Patch Changes

  • ddefbff: Added guard to stop multiple simultaneous calls to ignition.deploy(...) at once (#6440)

3.0.0

Major Changes

  • 29cc141: First release of Hardhat 3!