Skip to content

Add stdout/stderr to error messages#397

Merged
sindresorhus merged 2 commits intomasterfrom
feat/error-message
Dec 18, 2019
Merged

Add stdout/stderr to error messages#397
sindresorhus merged 2 commits intomasterfrom
feat/error-message

Conversation

@ehmicky
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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