We have our own system of resolving errors, so that no errors we resolve are printed to console. Nevertheless, internal handleSpecificErrors(...), which is used in almost all hardhat-ethers blockchain interaction functions, console logs the error it does not recognize. We would like to be able to tweak that logic.
Solution
An ability to control error's logging either via already existing logging option or via adding some new one.
Alternatives
There exists one alternative solution to the problem, but it is ugly. handleSpecificErrors(...) logs errors using console.error. We can turn off console.error entirely before executing any hardhat-deploy function, which logs errors, and reinstate console.error thereafter.
Importancy
4/10
Related to
Logging, settings, error handling.
Problem
We have our own system of resolving errors, so that no errors we resolve are printed to console. Nevertheless, internal
handleSpecificErrors(...)
, which is used in almost allhardhat-ethers
blockchain interaction functions, console logs the error it does not recognize. We would like to be able to tweak that logic.Solution
An ability to control error's logging either via already existing
logging
option or via adding some new one.Alternatives
There exists one alternative solution to the problem, but it is ugly.
handleSpecificErrors(...)
logs errors usingconsole.error
. We can turn offconsole.error
entirely before executing anyhardhat-deploy
function, which logs errors, and reinstateconsole.error
thereafter.