This packages has the definition of the error classes used by Hardhat, and the list of possible errors.
This module exports:
- The error class
HardhatError
, which has a static fieldERRORS
, with the differentErrorDescriptors
that it accepts. - 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. - The interface
ErrorDescriptor
. - The assertion helper
assertHardhatInvariant
.