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

Make error messages more consistent #230

Merged
merged 3 commits into from
May 10, 2019
Merged

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented May 10, 2019

This makes error.message more consistent.

execa errors in the following cases:
a) exit code is defined and is not 0
b) child process error event, or stdin error event
c) signal termination (including cancel())
d) timeout
e) stream error (separate issue: #228)

a) c) d) e) look consistent. However b):

  • prints stdout and stderr, as opposed to the others. This can also lead to unexpectedly (very) long error messages, which might create issues for some users. error.stdout and error.stderr can be used instead.
  • does not print the command, as opposed to the others.

This adjusts b) error message to the same format used by the other errors.

It turns out to cover this, I just had to remove unit tests but did not need to add new ones (could not think of one not already covered).

@ehmicky ehmicky requested a review from sindresorhus May 10, 2019 12:31
@ehmicky ehmicky force-pushed the feature/consistent-errors branch from 3dc063b to 13f49f3 Compare May 10, 2019 12:50
@ehmicky
Copy link
Collaborator Author

ehmicky commented May 10, 2019

CI is now passing.

@sindresorhus sindresorhus merged commit 5f8bd52 into master May 10, 2019
@sindresorhus sindresorhus deleted the feature/consistent-errors branch May 10, 2019 15:40
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