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

error.bufferedData is missing in 7.0.0 (except on maxBuffer error) #56

Closed
ehmicky opened this issue Aug 6, 2023 · 2 comments · Fixed by #63
Closed

error.bufferedData is missing in 7.0.0 (except on maxBuffer error) #56

ehmicky opened this issue Aug 6, 2023 · 2 comments · Fixed by #63

Comments

@ehmicky
Copy link
Collaborator

ehmicky commented Aug 6, 2023

Before 7.0.0, when the stream errored, the currently buffered data would be available as error.bufferedData. Since 7.0.0, this is not the case anymore, except when maxBuffer is hit.

Re-adding this feature should be fairly simple and non-breaking, since the data is already being buffered in the code, i.e. we'd only need to add a try/catch handler that sets error.bufferedData = getBufferedValue(). I'm happy to submit a PR if that sounds good.

This issue is preventing Execa from upgrading get-stream from v6 to v7. This is because Execa sets error.stdout, error.stderr and error.all using the logic described above.

https://github.com/sindresorhus/execa/blob/65992b418816b965d2e3f89b44d3c259ecd0c99a/lib/stream.js#L75-L89

@sindresorhus
Copy link
Owner

Sounds good. It was just an oversight. PR welcome :)

@ehmicky
Copy link
Collaborator Author

ehmicky commented Aug 7, 2023

Done at #63.

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 a pull request may close this issue.

2 participants