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

Add stdout/stderr to error messages #397

Merged
merged 2 commits into from Dec 18, 2019
Merged

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Dec 7, 2019

Fixes #395.

This adds stderr and stdout (in that order) to error messages.

stdout and stderr are not added when they are not available, for example when they are streamed (stdio: 'inherit').

A new property error.shortMessage is added to retrieve error messages without stdout/stderr in case users need shorter error messages.

This PR includes tests, documentation, TypeScript types.

Examples for error.errno were also adjusted to match Node 13 output.

@sindresorhus
Copy link
Owner

Should we maybe also update the .message docs to explicitly say it includes stdout/stderr? We could also mention which order they're added, that they're separated by a newline and that they're not interleaved.

@ehmicky
Copy link
Collaborator Author

ehmicky commented Dec 16, 2019

Sounds good. Fixed in 29a4737.

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.

Include stdout/stderr in error.message
2 participants