trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 678 forks source link

fix: add `"EADDRINUSE"` as `code` to server `Error` #4045

Closed davidmurdoch closed 1 year ago

davidmurdoch commented 1 year ago

This PR sets the code property related to the error "listen EADDRINUSE: address already in use { address }" to "EADDRINUSE", making detecting this kind of "address in use" error programmatically much easier and straightforward. This property existed in Ganache v6 and earlier and was removed in v7.0.0 in error.

Previously:

{
  "message": "listen EADDRINUSE: address already in use 127.0.0.1:5001"
}

Now:

{
  "code": "EADDRINUSE",
  "message": "listen EADDRINUSE: address already in use 127.0.0.1:5001"
}

Fixes #4020

gitpoap-bot[bot] commented 1 year ago

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2023 Ganache Contributor:

GitPOAP: 2023 Ganache Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.