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

Can not catch server startup errors #1106

Closed
adam-thomas-privitar opened this issue Apr 24, 2020 · 0 comments · Fixed by #1107
Closed

Can not catch server startup errors #1106

adam-thomas-privitar opened this issue Apr 24, 2020 · 0 comments · Fixed by #1107
Labels

Comments

@adam-thomas-privitar
Copy link

Describe the bug
Currently, createServer calls server.listen but this method always resolves, even if there is a problem such as the port being taken. This means ultimately these exceptions land as unhandled exceptions as there is no way to handle them.

To Reproduce

  1. Start prism-cli on a certain port.
  2. In another terminal start one on the same port.

Expected behaviour
I'd expect the promise to reject, which would allow those of us using createServer directly to handle the scenario. It would also allow prism-cli to respond gracefully without causing an unhandled exception.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (remove any that are not applicable):

  • Library version: 3.3.3
  • OS: OSX Catalina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant