wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.18k stars 286 forks source link

Add a way to suppress error logging #387

Open nksazonov opened 1 year ago

nksazonov commented 1 year ago

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 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.