You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Discrepancies between error list and documentation #15038
There are a few discrepancies between the errors defined in lib/internal/errors.js and those appearing in the documentation in doc/api/errors.md. The differences are outlined below (I compiled this list manually, and it's possible some errors are missing -- please comment if so!!), and this should be fairly straightforward to solve -- people would just need to submit PRs to fill in the missing documentation :)
Something else to consider is how to prevent this from happening in the future. I've been playing around with some ESLint stuff, but would appreciate people's thoughts on this.
@maclover7 thank you for doing this!
For context, there is a medium-term goal of refactoring out the error codes from internal/errors.js into a resource file that could be shared with other modules more easily. This will probably also make linting the docs for discrepancies much more simple.
Also since all the errors changes are semver-major we plan on auditing all the codes before v9.x is compiled.
Until then IMHO human auditing (during PRs that introduce new codes, and systematic reviews like you just did) are probably the most cost effective.
Activity
refack commentedon Aug 27, 2017
@maclover7 thank you for doing this!
For context, there is a medium-term goal of refactoring out the error codes from
internal/errors.jsinto a resource file that could be shared with other modules more easily. This will probably also make linting the docs for discrepancies much more simple.Also since all the
errorschanges aresemver-majorwe plan on auditing all the codes beforev9.xis compiled.Until then IMHO human auditing (during PRs that introduce new codes, and systematic reviews like you just did) are probably the most cost effective.
/cc @jasnell
gnbezerra commentedon Aug 30, 2017
Is this good for a first PR, I guess? Correct me if I'm wrong.
Anyway, I'll try to submit a PR by tomorrow updating the errors in the documentation.
Edit: taking a bit more time than I expected due to other obligations, but I'm still on it.
gnbezerra commentedon Aug 30, 2017
About the list @maclover7 compiled, just a few corrections to it:
lib/internal/errors.jsanddoc/api/errors.mdlib/internal/errors.js, but not listed indoc/api/errors.mdlib/internal/errors.js, but is listed indoc/api/errors.mdOh, and thank you for calling attention to this issue, @maclover7!
doc: document missing error codes
doc: document missing error codes