Remove "please report to the Hardhat team" from `hardhat-verify`
We see lots of issues with hardhat-verify that are really temporary issues with the block explorer or an odd setup, or just a block explorer that doesn't meet the expected api. However due to our error message, it is reported as an issue:
Etherscan:
An unexpected error occurred during the verification process.
Please report this issue to the Hardhat team.
Error Details: Unexpected token '<', "
<!DOCTYPE "... is not valid JSON
To give an example: https://github.com/NomicFoundation/hardhat/issues/5111
We should alter this error message to:
- Remove the request to report the issue
- If we can pass through any more details from the underlying error/block explorer, that we do that
In particular, if we could display more of the failed http response (particularly if it is an HTML file) we are likely to get less support requests - maybe include the entirety of the failed http response in debug for instance.
Our goal here is to try and minimize the support burden of issues in the block explorers taking up Hardhat investigation time.
Chiming in from Etherscan, open to ideas how to directly forward suspected verification API issues to us!
Talking it through some more. Etherscan is providing only that the verification failed, no further details. Other block explorers might throw an http error and return an html error page.
So lets look at
- Change the error to indicate:
- verification worked locally, this is not a HH issue
- your next steps are to work with the block explorer directly, as they are giving no more details
- if it is an http error rather than a 200 but failed verification we should investigate what printing the entire output would look like. Maybe look at hiding this behind debug with a note to include debug to see more details.