fs: fix link and symlink error messages#9263
fs: fix link and symlink error messages#9263schnittstabil wants to merge 2 commits intonodejs:masterfrom schnittstabil:fix-fs-link-errors
Conversation
Currently, the error messages for missing arguments of symlink, link, symlinkSync and linkSync are swapped. Additionally they are named inconsistently all over the sources and the docs. In addition, #8920 shows that the meaning of `srcpath` and `dstpath` isn't clear and the docs aren't comprehensive enough. This PR changes `srcpath` to `target` and `dstpath` to `path` in the docs and the sources and make the code more consistent.
|
In io.js this was further improved: nodejs/node@bc2c85c |
|
@piscisaureus does the io.js patch include the commits in PR, complement them, or provide an alternate for them? |
|
@jasnell my patch predates this one. It fixes more things, including an incorrect invocation of ThrowUVException(). Look at the commit message to see all the details. And feel free to judge for yourself. We may want to land the test and doc changes from this PR. |
|
I like the improvements of @piscisaureus, but haven't known them. The only thing that I personally would prefer are better parameter names for link and symlink, consistently used within sources and docs, so that error messages aren't such misleading (see also here). From ln:
From mklink:
Therefore I'd vote for |
|
@schnittstabil ... if you'd like to pursue this change further, opening a new updated one against https://github.com/nodejs/node master would be the right approach. This is not going to be able to land here in it's current state. I'm going to go ahead and close this but can reopen if necessary |
Currently, the error messages for missing arguments of symlink, link, symlinkSync and linkSync are swapped. Additionally they are named inconsistently all over the sources and the docs.
From the docs:
But the error messages doesn't match:
There are two things to mention here:
dstpathis missing, not thesrcpathargumentsrc, it'ssrcpathIn addition, #8920 shows that the meaning of
srcpathanddstpathisn't clear and the docs aren't comprehensive enough.This PR changes
srcpathtotargetanddstpathtopathin the docs and the sources, and make the code more consistent.