Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve error messages when an error event is emitted #269

Merged
merged 4 commits into from
May 30, 2019

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented May 30, 2019

When an error event is emitted directly on the child process, the error message is currently bad:

const child = execa('echo');
child.emit('error', new Error('test'));
// Prints: Command failed with exit code undefined (undefined): echo \n test
child.catch(error => console.log(error.message)

This fixes that.

@sindresorhus sindresorhus merged commit 2307d95 into master May 30, 2019
@sindresorhus sindresorhus deleted the feature/process-errors branch May 30, 2019 13:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants