Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

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

Merged
merged 3 commits into from
Jan 4, 2023
Merged

Conversation

davidmurdoch
Copy link
Member

@davidmurdoch davidmurdoch commented Dec 15, 2022

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

@davidmurdoch davidmurdoch marked this pull request as ready for review December 16, 2022 01:40
@davidmurdoch davidmurdoch force-pushed the fix/EADDRINUSE branch 2 times, most recently from f82c064 to 3a01b6f Compare December 16, 2022 21:50
src/packages/core/src/server.ts Outdated Show resolved Hide resolved
davidmurdoch and others added 3 commits December 21, 2022 16:58
@davidmurdoch davidmurdoch merged commit 3b2b474 into develop Jan 4, 2023
@davidmurdoch davidmurdoch deleted the fix/EADDRINUSE branch January 4, 2023 20:13
@gitpoap-bot
Copy link

gitpoap-bot bot commented Jan 4, 2023

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EADDRINUSE error is uncoded, most of the time
3 participants