net: throw error if port does not exist in options#22085
net: throw error if port does not exist in options#22085yanivfriedensohn wants to merge 7 commits into
Conversation
|
Semver-major because of the addition of a new throw. @nodejs/tsc ... PTAL. I'm not yet convinced this is definitely something we should do. |
|
Hi, @yanivfriedensohn and welcome! Thanks for the PR. I think the added error is not quite right. If I understand correctly, |
|
Hi @Trott, based on your suggestions, I added an additional error message argument to |
c75c291 to
dc961c8
Compare
|
@yanivfriedensohn Would you be able to add some tests for the new behavior? We can run CI on this after that |
|
How does this fix #16712 ? It requested
|
|
Note that |
8bed77c to
7498e3c
Compare
|
@maclover7 I added tests for the additional error message. @joyeecheung this fixes:
The message mentions that |
|
@yanivfriedensohn In that case please do not put |
There was a problem hiding this comment.
typeof options === 'object' here is always true since it's normalized before
There was a problem hiding this comment.
This error message will not be accurate since options is an argument, not an option value - the user does not pass { options: { ... } } to this method. ERR_INVALID_ARG_VALUE may be more accurate.
7498e3c to
4862c1f
Compare
|
@joyeecheung following your suggestion, I used |
|
Tests have been added so I've removed the |
|
@joyeecheung is this ready for CI? |
Throw error ERR_PROPERTY_NOT_IN_OBJECT if the port property does not exist in the options object argument when calling server.listen(). Refs: nodejs#16712
4862c1f to
630d987
Compare
|
Rebased and force pushed to resolve the dreaded jinja LICENSE CRLF thing. (I think we'll all be happy when that problem is a few weeks in the past.) |
|
Resume Build: https://ci.nodejs.org/job/node-test-pull-request/16705/ |
|
@Trott is this |
|
Landed in 4a0466f 🎉 |
Throw error ERR_INVALID_ARG_VALUE if the port and path properties do not exist in the options object argument when calling server.listen(). Refs: #16712 PR-URL: #22085 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

Throw error ERR_PROPERTY_NOT_IN_OBJECT if the port property does not
exist in the options object argument when calling server.listen().
Refs: #16712
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes#SimilarWeb_RnD