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

Fix shape of exceptions thrown by execa.sync() #277

Merged
merged 2 commits into from Jun 11, 2019

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Jun 10, 2019

When some options like timeout are invalid, child_process.spawnSync() throws synchronously. When this happens, the exception thrown does not use the same shape as the other execa errors.

This PR fixes this.

Note: the options that make child_process.spawnSync() and child_process.spawn() throw are different. For example uid: -1 makes spawn() throw but not spawnSync(). This is the opposite for timeout: -1. Because of this, the tests were wrong, which is why this bug was not caught.

@sindresorhus sindresorhus merged commit 048b23e into master Jun 11, 2019
@sindresorhus sindresorhus deleted the feature/early-exception-sync branch June 11, 2019 04:22
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.

None yet

2 participants