-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
lib: http server, friendly error messages #22995
Conversation
cc @nodejs/tsc This is semver-major because it touches errors that are not in our ERR_CODE system and are potentially parsed by users. |
It touches only in the error description and not in the error code which is stays the same, users are parsing the codes and not the error message. |
/ping @nodejs/chakracore Is this compatible with ChakraCore or will this be something you'll need to patch over in |
Unfortunately, parsing of error message strings has been widespread in the ecosystem because there was no other alternative for a long time. |
As far as I can tell, these errors already do have a |
If the errors already have a |
Indeed errors have a Current error properties:
|
@addaleax Ah. I didn't see the usual tell-tale |
Yes, but these are libuv error codes, not our supposed-to-be-permanent error codes, so less justification to not go semver-major. That said we can try a CITGM and see, worse case secnario this does break and we can always revert. |
For the most part, libuv forwards errors returned from the OS, which are typically spec’d and therefore usually provide more long-term stability than our errors. Plus, changing an error code in libuv would definitely be semver-major on their side, so it would also land in a semver-major change in Node.js.
Yup – CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1570/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as semver-major.
e1d2978
to
c3738fb
Compare
@sagitsofan I don’t know why, but for some reason, there’s over 50 commits listed in this PR – could you rebase this against [Super-short how-to: |
cd55d21
to
e0cba9c
Compare
Use backticks around `SHASUM256.txt` etc. in README.md. PR-URL: nodejs#23299 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Use fast-tracking on PRs where new Collaborators are adding themselves to the README. PR-URL: nodejs#23300 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
The internal `assert` modules `errorCache` property is exposed only for testing. The one test that used it is rewritten here to not use it. This has the following advantages: * The test now makes sure that there is an empty cache in a more robust way. Instead of relying on the internal implementation of `errorCache`, it simply spawns a separate process. * One less test using the `--expose-internals` flag. PR-URL: nodejs#23304 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
The internal assert module exposed an errorCache property solely for testing. It is no longer necessary. Remove it. PR-URL: nodejs#23304 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Comments clarification at the deprecated function and new function. Fixes: nodejs#22936
Comments clarification Fixes: nodejs#22936
f1d4cc0
to
fdb7b3e
Compare
@addaleax Done, can it land? |
CI: https://ci.nodejs.org/job/node-test-pull-request/17746/ @sagitsofan Thanks! There should be nothing you need to do here. :) I’ve added the |
Landed in 82ea705 🎉 Thanks for the PR! |
Improved error message description for the http server binding errors. Currently changed only 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. example: old error message: `listen EADDRINUSE` new error message: `listen EADDRINUSE: Address already in use` 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 PR-URL: #22995 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
🎊 this will come out in version 12, right? Since the |
Improved error message description for the http server binding errors. Currently changed only 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. example: old error message: `listen EADDRINUSE` new error message: `listen EADDRINUSE: Address already in use` 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 PR-URL: #22995 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
Improved error message description for the http server binding errors. Currently changed only 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. example: old error message: `listen EADDRINUSE` new error message: `listen EADDRINUSE: Address already in use` 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 PR-URL: #22995 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
@ericandrewlewis Version 10 is at October not version 11, |
Improved error message description for the http server binding errors. Currently changed only 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. example: old error message: `listen EADDRINUSE` new error message: `listen EADDRINUSE: Address already in use` 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 PR-URL: #22995 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
Improved error message description for the http server binding errors. Currently changed only 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. example: old error message: `listen EADDRINUSE` new error message: `listen EADDRINUSE: Address already in use` 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 PR-URL: #22995 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
Improved error message description for the http server binding errors. Currently changed only 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. example: old error message: `listen EADDRINUSE` new error message: `listen EADDRINUSE: Address already in use` 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 PR-URL: #22995 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
Improved error message description for the http server binding errors. Currently changed only 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. example: old error message: `listen EADDRINUSE` new error message: `listen EADDRINUSE: Address already in use` 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 PR-URL: #22995 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
lib: improved error message description for the http server binding errors.
currently changed only in
setupListenHandle
function, but needs to be change all over.Added new
uvExceptionWithHostPort
function (+export) inlib/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.example:
old error message:
listen EADDRINUSE
new error message:
listen EADDRINUSE: Address already in use
adjust tests to the new error.
Issue: #22936
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes