Skip to content

Conversation

@jasnell
Copy link
Member

This does not use the internal/errors.js module because the error in question may actually be caused by an attempt to load internal/errors.js. This error should only be encountered in the case of a bug within Node.js itself.

Ref: #11273

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

errors, src

@jasnelljasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Feb 10, 2017
@nodejs-github-botnodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. lib / src Issues and PRs related to general changes in the lib or src directory. labels Feb 10, 2017
@Fishrock123
Copy link
Contributor

This is perhaps misleading as these are not necessarily "native" as in "C/C++" modules.

@jasnell
Copy link
MemberAuthor

Yep. It certainly is. Basing this off the existing wording (I did not change the error message at all). Do you have a suggestion for an alternative?

Copy link
Member

@joyeecheungjoyeecheungFeb 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need a section explaining the new error system(like the section on "system errors" above mentioning those would have error.code, error. errno and error. syscall properties, then list the error codes). Going straight to error code descriptions seems pretty confusing if people read it from the top to the bottom...

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I agree. I was thinking of doing that in a separate PR

@joyeecheung
Copy link
Member

@jasnell@Fishrock123 do we have a name for the lib modules in general?

@joyeecheung
Copy link
Member

LGTM with the naming sorted out

@jasnell
Copy link
MemberAuthor

@joyeecheung ... not really with regards to naming. Perhaps built-in or internal would work?

@joyeecheung
Copy link
Member

Sorry, I wasn't being clear. I meant I am fine with native as long as we have a decision native is the word we use for lib modules, whichever we use we should stick to that :D

I do think built-in would be more unambiguous though. For contributors internal sounds like lib/internal modules, but if I understand correctly this covers unknown lib modules.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we let the tools to generate the id for all these? It would be consistent that way.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because these anchors need to be consistent and predictable even if the structure of the document changes. Doing it this way ensures that the anchors will not change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the error message is updated to No such built-in module, the error code should be changed accordingly?

@jasnell
Copy link
MemberAuthor

Updated. PTAL

@jasnelljasnell added semver-major PRs that contain breaking changes and should be released in the next major version. and removed semver-minor PRs that contain new features and should be released in the next minor version. labels Feb 14, 2017
@jasnell
Copy link
MemberAuthor

Ping @nodejs/ctc ... can I get a review on this?

@jasnell
Copy link
MemberAuthor

Copy link
Member

@mhdawsonmhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasnelljasnell added the blocked PRs that are blocked by other issues or PRs. label Apr 5, 2017
@jasnelljasnell removed the blocked PRs that are blocked by other issues or PRs. label Apr 20, 2017
@jasnell
Copy link
MemberAuthor

This is no longer blocked. PR updated.
@targos@mhdawson@joyeecheung ... PTAL, does this still LGTY?

@Fishrock123
Copy link
Contributor

Fishrock123 commented Apr 20, 2017

I think this is a misnomer, IIRC that module does not need to be built-in to possibly hit this path? (Don't all native modules hit this or something?)

Note: I understand it is called "NativeModule as in "builtin natives".

@jasnell
Copy link
MemberAuthor

Not that I'm aware of. In every condition that I was able to find, most users will only see the "Cannot find module" error. This appears to be hit only in very specific cases involving the built-in modules. I could be wrong, but that's what I've been able to see. There's aren't even any test cases that I can see that trigger/test this.

@joyeecheung
Copy link
Member

@jasnell FWIW, I have only ever hit this path when I accidentally deleted a js file from node.gyp...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: There is a colon in errors.js file

@jasnell
Copy link
MemberAuthor

@jasnell
Copy link
MemberAuthor

@Fishrock123 ... are you satisfied with this?

Copy link
Member

@targostargos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a nit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there should be a space now that 7b4a72d has landed.

This does not use the internal/errors.js module because the error in question may actually be *caused* by an attempt to load internal/errors.js. This error should only be encountered in the case of a bug within Node.js itself. Ref: nodejs#11273
jasnell added a commit that referenced this pull request Apr 24, 2017
This does not use the internal/errors.js module because the error in question may actually be *caused* by an attempt to load internal/errors.js. This error should only be encountered in the case of a bug within Node.js itself. PR-URL: #11298 Ref: #11273 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
@jasnell
Copy link
MemberAuthor

Landed in 251e5ed

@jasnelljasnell closed this Apr 24, 2017
@Fishrock123
Copy link
Contributor

Hmm, ok sounds good to me. Belated LGTM.

@jasnelljasnell mentioned this pull request May 11, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

errorsIssues and PRs related to JavaScript errors originated in Node.js core.lib / srcIssues and PRs related to general changes in the lib or src directory.semver-majorPRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@jasnell@Fishrock123@joyeecheung@thefourtheye@targos@mhdawson@Trott@nodejs-github-bot