Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully fail if something is already running on port 8005 #33

Open
andrew opened this issue Feb 2, 2021 · 0 comments
Open

Gracefully fail if something is already running on port 8005 #33

andrew opened this issue Feb 2, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@andrew
Copy link
Member

andrew commented Feb 2, 2021

Current output if you try to start forest server whilst something is already on 8005:

$ forest server
Connected to IPFS
Watching for new upstream releases for cached packages
node:events:356
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::8005
    at Server.setupListenHandle [as _listen2] (node:net:1312:16)
    at listenInCluster (node:net:1360:12)
    at Server.listen (node:net:1447:7)
    at /Users/andrewnesbitt/code/forest/lib/commands/server.js:11:12
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1339:8)
    at processTicksAndRejections (node:internal/process/task_queues:81:21) {
  code: 'EADDRINUSE',
  errno: -48,
  syscall: 'listen',
  address: '::',
  port: 8005
}

We can catch that error and show a nice message.

Related to #24 so users can configure a different port to use.

@andrew andrew added the enhancement New feature or request label Feb 2, 2021
@andrew andrew added the help wanted Extra attention is needed label Apr 21, 2021
@andrew andrew added this to the 0.1.0 milestone Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant