Skip to content
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

debugger, errors: migrate to use internal/errors.js #11380

Closed
wants to merge 4 commits into from
Closed

debugger, errors: migrate to use internal/errors.js #11380

wants to merge 4 commits into from

Conversation

shubheksha
Copy link
Contributor

Fixes #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)

debugger, errors, test

Use the new error code defined in internal/errors for _debugger.js
@nodejs-github-bot nodejs-github-bot added debugger errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Feb 14, 2017
## Node.js Error Codes

<a id="ERR_UNK_STATE"></a>
### ERR_INVALID_CALLBACK
Copy link
Member

Choose a reason for hiding this comment

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

Code name doesn't match the anchor here. Also probably spelling the UNKNOWN in full would be easier to understand? The description below is not particularly helpful if someone encounters this error and tries to look it up, probably ERR_UNKNOWN_DEBUGGER_STATE and some more explanation would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that. I've fixed it in the latest commit. I'm not sure what more can I add to the explanation. Could you please guide me a little about that? Thanks!

@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 14, 2017
Add more explanation for the error code and replace it with a more verbose alternative
Copy link
Member

@joyeecheung joyeecheung 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 suggestion.

<a id="ERR_UNKNOWN_DEBUGGER_STATE"></a>
### ERR_UNKNOWN_DEBUGGER_STATE

The `'ERR_UNKNOWN_DEBUGGER_STATE'` error code is used to identify that the state of the debugger is not known.
Copy link
Member

@joyeecheung joyeecheung Feb 15, 2017

Choose a reason for hiding this comment

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

@shubheksha According to the history I think the test of this comes from #8454 and the code dates back to 8d82ec2, this looks like just a safety net in case anyone accidentally set the .state from outside and break the state machine, so probably we can add a sentence at the end: ...not known, possibly set by code outside the debugger module.

On another note, debugger module is deprecated and is going to be replaced by node inspect, so this error probably would not stay that long in the code base. Thanks for the contribution anyway!

Copy link
Member

Choose a reason for hiding this comment

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

Also can you add a line break in the sentence so it wraps in ~80 characters? Thanks!

- Added more documentation about ERR_UNKNOWN_DEBUGGER_STATE error code
@shubheksha
Copy link
Contributor Author

@joyeecheung, fixed it! Let me know if any other changes are needed. Thanks!

@joyeecheung
Copy link
Member

joyeecheung commented Feb 15, 2017

Still LGTM but I think this would need a review from @jasnell, and maybe more eyeballs :)

CI: https://ci.nodejs.org/job/node-test-pull-request/6423/

@jasnell jasnell added the blocked PRs that are blocked by other issues or PRs. label Apr 5, 2017
@TimothyGu
Copy link
Member

_debugger.js was removed from master in #12495 / 90476ac, obsoleting this PR.

@shubheksha, sorry for not informing you of this part of our plan beforehand, and thank you for contributing! There are still many files to migrate in #11273, so please feel free to take up some of them.

@TimothyGu TimothyGu closed this Apr 21, 2017
@TimothyGu TimothyGu removed the blocked PRs that are blocked by other issues or PRs. label Apr 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. semver-major PRs 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.

5 participants