FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: add test case for send command error case by antsmartian · Pull Request #31133 · nodejs/node · GitHub

/ node Public

test: add test case for send command error case - #31133

Closed
antsmartian wants to merge 1 commit into
nodejs:masterfrom
antsmartian:test-inspector-error
Closed

test: add test case for send command error case#31133
antsmartian wants to merge 1 commit into
nodejs:masterfrom
antsmartian:test-inspector-error

Conversation

antsmartian commented Dec 30, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

Added test case for a error scenario, which wasn't covered before: https://coverage.nodejs.org/coverage-cc3f2b386c6ee34f/lib/internal/util/inspector.js.html#L21

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

nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 30, 2019

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Trott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Would be good if we could test this without --expose-internal but that might be difficult? @nodejs/inspector

BridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't think this is the right thing to do.
From the API perspective the passed through callback is a user defined callback. It should therefore not catch the error from inside the callback and instead end up as an uncaught exception or be handled by the "user".
The only way to fix this seems to be to completely remove the outer try / catch in lib/internal/util/inspector.js. // cc @targos

BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 1, 2020
The API caught errors from inside of the users passed through callback.
This never caused any issues, since this API is only used internally.
Otherwise it would have potentially hidden bugs in user code.

Refs: nodejs#31133
BridgeAR mentioned this pull request Jan 2, 2020
4 tasks
Trott pushed a commit that referenced this pull request Jan 4, 2020
The API caught errors from inside of the users passed through callback.
This never caused any issues, since this API is only used internally.
Otherwise it would have potentially hidden bugs in user code.

Refs: #31133

PR-URL: #31159
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

Trott commented Jan 4, 2020

Copy link
Copy Markdown
Member

With #31159 landed, is this PR obsolete? @BridgeAR @antsmartian

BridgeAR commented Jan 4, 2020

Copy link
Copy Markdown
Member

@Trott I would say so. The only thing that could be tested is if throwing an error in the callback ends up as uncaught exception. Such a test would be unusual though.

@antsmartian I hope it's fine that I close this for that reason.

BridgeAR closed this Jan 4, 2020
targos pushed a commit that referenced this pull request Jan 6, 2020
The API caught errors from inside of the users passed through callback.
This never caused any issues, since this API is only used internally.
Otherwise it would have potentially hidden bugs in user code.

Refs: #31133

PR-URL: #31159
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
targos pushed a commit that referenced this pull request Jan 14, 2020
The API caught errors from inside of the users passed through callback.
This never caused any issues, since this API is only used internally.
Otherwise it would have potentially hidden bugs in user code.

Refs: #31133

PR-URL: #31159
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
targos pushed a commit that referenced this pull request Jan 14, 2020
The API caught errors from inside of the users passed through callback.
This never caused any issues, since this API is only used internally.
Otherwise it would have potentially hidden bugs in user code.

Refs: #31133

PR-URL: #31159
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
The API caught errors from inside of the users passed through callback.
This never caused any issues, since this API is only used internally.
Otherwise it would have potentially hidden bugs in user code.

Refs: #31133

PR-URL: #31159
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL