Skip to content

Conversation

@targos
Copy link
Member

@targos targos commented Mar 16, 2018

Assign a code to a user-facing error.
Turn other internal-only errors to checks.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@targos targos added inspector Issues and PRs related to the V8 inspector protocol errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Mar 16, 2018
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Mar 16, 2018
@targos targos added the semver-major PRs that contain breaking changes and should be released in the next major version. label Mar 16, 2018
Copy link
Member

Choose a reason for hiding this comment

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

Extra s.

Copy link
Member

@fhinkel fhinkel 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 typo pointed out by @richardlau.

@targos
Copy link
Member Author

targos commented Mar 16, 2018

@targos targos force-pushed the error-codes-inspector branch from 2faae1f to 38a566e Compare March 20, 2018 12:30
@targos
Copy link
Member Author

targos commented Mar 20, 2018

Copy link
Member

@joyeecheung joyeecheung Mar 20, 2018

Choose a reason for hiding this comment

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

Should this reuse the ERR_INSPECTOR_ALREADY_CONNECTED instead of creating a new error? From what I can tell, the only distinction is that if you connect from the same session twice, you get an ERR_INSPECTOR_ALREADY_CONNECTED, whereas if you connect from another session, you get an ERR_INSPECTOR_ALREADY_ATTACHED, but the cause are the same: there is a current connected session, whether it's the same one or a different one does not seem to make a big difference.

To get out of ERR_INSPECTOR_ALREADY_CONNECTED, the user can call.disconnect(), but there is not a method called .detach() that a user can use to get out of ERR_INSPECTOR_ALREADY_ATTACHED, they still need to .disconnect() to detach - and there is no explanation about attach in the inspector documentation. IMO the difference should probably be told in the error message, not in the code, so it's [ERR_INSPECTOR_ALREADY_CONNECTED]: the inspector session is already connected v.s. [ERR_INSPECTOR_ALREADY_CONNECTED]: another inspector session is already connected

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I'm going to change this.

Assign a code to a user-facing error.
Turn other internal-only errors to checks.
@targos targos force-pushed the error-codes-inspector branch from 38a566e to c08f887 Compare March 21, 2018 07:33
@targos
Copy link
Member Author

targos commented Mar 21, 2018

@targos
Copy link
Member Author

targos commented Mar 21, 2018

CI is green. Is everyone OK with @joyeecheung's suggestion?

@targos
Copy link
Member Author

targos commented Mar 22, 2018

Landed in 4e1f090

@targos targos closed this Mar 22, 2018
@targos targos deleted the error-codes-inspector branch March 22, 2018 07:41
targos added a commit that referenced this pull request Mar 22, 2018
Assign a code to a user-facing error.
Turn other internal-only errors to checks.

PR-URL: #19387
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. errors Issues and PRs related to JavaScript errors originated in Node.js core. inspector Issues and PRs related to the V8 inspector protocol lib / src Issues and PRs related to general changes in the lib or src directory. 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.

8 participants