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

src: pass along errors from object instantiations (part II) #25822

Closed
wants to merge 4 commits into from

Conversation

addaleax
Copy link
Member

This addresses the slightly harder-to-address cases of potentially failing NewInstance() calls.

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

@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 Jan 30, 2019
@addaleax
Copy link
Member Author

addaleax commented Feb 1, 2019

CI: https://ci.nodejs.org/job/node-test-pull-request/20530/ (:white_check_mark:)

@addaleax
Copy link
Member Author

addaleax commented Feb 6, 2019

Any volunteers for review? :)

@addaleax
Copy link
Member Author

addaleax commented Feb 8, 2019

Maybe @gireeshpunathil @joyeecheung or somebody from @nodejs/workers?

@gireeshpunathil
Copy link
Member

sure, will have a look!

@@ -404,19 +410,19 @@ class FileHandle : public AsyncWrap, public StreamBase {
FileHandle& operator=(const FileHandle&&) = delete;

private:
FileHandle(Environment* env, v8::Local<v8::Object> obj, int fd);

// Synchronous close that emits a warning
void Close();
void AfterClose();

class CloseReq : public ReqWrap<uv_fs_t> {
public:
CloseReq(Environment* env,
Copy link
Member

Choose a reason for hiding this comment

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

any reason why CloseReq does not follow the suit - i.e., a private constructor and a static factory?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just that it’s used at only one call site rather than multiple ones. I can add/use a factory constructor if you like?

Copy link
Member

Choose a reason for hiding this comment

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

ok, I thought so. I think it is fine; doesn't look like anything beneficial of doing so.

@addaleax
Copy link
Member Author

addaleax commented Feb 8, 2019

Landed in d999b55...8b79c15

@addaleax addaleax closed this Feb 8, 2019
@addaleax addaleax deleted the new-instance-2 branch February 8, 2019 20:07
addaleax added a commit that referenced this pull request Feb 8, 2019
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
addaleax added a commit that referenced this pull request Feb 8, 2019
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
addaleax added a commit that referenced this pull request Feb 8, 2019
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
addaleax added a commit that referenced this pull request Feb 8, 2019
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
addaleax added a commit that referenced this pull request Feb 8, 2019
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
addaleax added a commit that referenced this pull request Feb 8, 2019
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
addaleax added a commit that referenced this pull request Feb 8, 2019
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
addaleax added a commit that referenced this pull request Feb 8, 2019
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
@targos targos mentioned this pull request Feb 14, 2019
BethGriggs pushed a commit that referenced this pull request Aug 15, 2019
[This backport applied to v10.x cleanly.]

Backport-PR-URL: #29123
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This was referenced Aug 15, 2019
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++. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants