Skip to content

Improving error messages description #22983

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

Closed
wants to merge 2 commits into from

Conversation

sagitsofan
Copy link
Contributor

lib: improved error message description for the http server binding errors.

changed in setupListenHandle, but needs to be change all over.

Added new uvExceptionWithHostPort function (+export) in lib/internal/error.js that extracts the error message defined by libuv, using the error code, and returns an error object with the full error description: 'address already in use' for example.

Removed exportable function _exceptionWithHostPort from lib/util.js - exported by accident

Replaced exceptionWithHostPort to the new function uvExceptionWithHostPort for a more detailed error.

Fixes: #22936

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

improve error message description for http server binding errors.
change only in 'setupListenHandle' but needs to be change all over.

1. added new `uvExceptionWithHostPort` function (+export) in 'lib/internal/error.js' that extracts the error message defined by libuv using the error code, and returns an error object with the error full description.
Instead of 'EADDRINUSE' -> 'address already in use'

2. removed exportable function `_exceptionWithHostPort` from lib/util.js - it was exported by accident

3. replaced 'exceptionWithHostPort' to the new function `uvExceptionWithHostPort` for a more detailed error.
@nodejs-github-bot nodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. net Issues and PRs related to the net subsystem. util Issues and PRs related to the built-in util module. labels Sep 20, 2018
@sagitsofan sagitsofan closed this Sep 20, 2018
@sagitsofan sagitsofan deleted the error-msg branch September 20, 2018 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. net Issues and PRs related to the net subsystem. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message for address already in use
2 participants