Skip to content

doc: add clarification for exception behaviour - #25339

Closed
mhdawson wants to merge 6 commits into
nodejs:masterfrom
mhdawson:exp-doc2
Closed

doc: add clarification for exception behaviour#25339
mhdawson wants to merge 6 commits into
nodejs:masterfrom
mhdawson:exp-doc2

Conversation

@mhdawson

Copy link
Copy Markdown
Member

Refs: nodejs/abi-stable-node#356

Document current behaviour where some methods can be called
when an exception is pending, while others cannot and explain
the behaviour.

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

Refs: nodejs/abi-stable-node#356
Document current behaviour where some methods can be called
when an exception is pending, while others cannot and explain
the behaviour.
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. node-api Issues and PRs related to the Node-API. labels Jan 4, 2019
Comment threaddoc/api/n-api.md Outdated
Comment threaddoc/api/n-api.md Outdated
Comment threaddoc/api/n-api.md Outdated
Comment threaddoc/api/n-api.md Outdated
called in order to allow for some minimal cleanup to be completed
before returning to JavaScript. For those functions, `napi_status`
will reflect the success/error/exception for that function, irrespective of
whether an exception was pending when the function was called.

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.

This sentence is difficult to understand. "for that function" is particularly confusing coming after "for those functions". Maybe try writing it as two shorter sentences or something? Or just tidying up the sentence that's there somehow?

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.

Maybe something like this?

In that case, `napi_status` will reflect the status for the function.
It will not reflect previous pending exceptions.

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.

(Obviously, change my suggestion if it is factually incorrect. I'm commenting on style and readability, not content.)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Your suggestion works for me. Updating.

@addaleaxaddaleax 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.

LGTM with @Trott’s suggestions

Trottand others added 5 commits January 7, 2019 11:19
Co-Authored-By: mhdawson <michael_dawson@ca.ibm.com>
Co-Authored-By: mhdawson <michael_dawson@ca.ibm.com>
Co-Authored-By: mhdawson <michael_dawson@ca.ibm.com>
@mhdawson

Copy link
Copy Markdown
MemberAuthor

@Trott fixed up as per your comments.

@mhdawson

Copy link
Copy Markdown
MemberAuthor

@danbev

Copy link
Copy Markdown
Contributor

Landed in b406c9c.

@danbevdanbev closed this Jan 9, 2019
danbev pushed a commit that referenced this pull request Jan 9, 2019
Document current behaviour where some methods can be called
when an exception is pending, while others cannot and explain
the behaviour.
PR-URL: #25339
Refs: nodejs/abi-stable-node#356
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
addaleax pushed a commit that referenced this pull request Jan 14, 2019
Document current behaviour where some methods can be called
when an exception is pending, while others cannot and explain
the behaviour.
PR-URL: #25339
Refs: nodejs/abi-stable-node#356
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@BridgeARBridgeAR mentioned this pull request Jan 16, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
Document current behaviour where some methods can be called
when an exception is pending, while others cannot and explain
the behaviour.
PR-URL: nodejs#25339
Refs: nodejs/abi-stable-node#356
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Jan 24, 2019
BethGriggs pushed a commit that referenced this pull request Apr 28, 2019
Document current behaviour where some methods can be called
when an exception is pending, while others cannot and explain
the behaviour.
PR-URL: #25339
Refs: nodejs/abi-stable-node#356
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@BethGriggsBethGriggs mentioned this pull request May 1, 2019
BethGriggs pushed a commit that referenced this pull request May 10, 2019
Document current behaviour where some methods can be called
when an exception is pending, while others cannot and explain
the behaviour.
PR-URL: #25339
Refs: nodejs/abi-stable-node#356
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins pushed a commit that referenced this pull request May 16, 2019
Document current behaviour where some methods can be called
when an exception is pending, while others cannot and explain
the behaviour.
PR-URL: #25339
Refs: nodejs/abi-stable-node#356
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.node-apiIssues and PRs related to the Node-API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@mhdawson@nodejs-github-bot@danbev@Trott@addaleax@lpinca@cjihrig