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

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

Closed
wants to merge 1 commit into from

Conversation

antsmartian
Copy link
Contributor

@antsmartian antsmartian commented Dec 30, 2019

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 nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 30, 2019
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

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

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

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 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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@Trott
Copy link
Member

Trott commented Jan 4, 2020

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

@BridgeAR
Copy link
Member

BridgeAR commented Jan 4, 2020

@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 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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
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