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

fork.js: Reject child-process completion promise with an error. #200

Merged
merged 1 commit into from
Nov 12, 2015

Conversation

jamestalmage
Copy link
Contributor

It is generally recommended to reject Promises with an error.
This becomes especially true with the move to async/await,
as Promise.reject(1) essentially becomes throw 1 in that context.

Not doing so was causing a weird bug on Node 0.10.

Ref: https://travis-ci.org/sindresorhus/ava/jobs/90709377#L779

It is generally recommended to reject Promises with an error.
This becomes especially true with the move to `async/await`,
as `Promise.reject(1)` essentially becomes `throw 1` in that context.

Not doing so was causing a weird bug on Node 0.10.
@jamestalmage jamestalmage mentioned this pull request Nov 12, 2015
@sindresorhus
Copy link
Member

Agreed. Rejecting without an error makes it impossible to see where it happened.

@sindresorhus
Copy link
Member

@jamestalmage
Copy link
Contributor Author

Passes on Windows 7 / Node 10 here.
I think it is just AppVeyor again.

Give me a moment. to get those logged in the tracking issue.

sindresorhus added a commit that referenced this pull request Nov 12, 2015
fork.js: Reject child-process completion promise with an error.
@sindresorhus sindresorhus merged commit 186fd78 into avajs:master Nov 12, 2015
@sindresorhus
Copy link
Member

Alright

@jamestalmage jamestalmage deleted the reject-with-error branch November 21, 2015 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants