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

Set error.bufferedData when stream errors #63

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Set error.bufferedData when stream errors #63

merged 1 commit into from
Aug 7, 2023

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Aug 7, 2023

Fixes #56.

This also adds tests for error.bufferedData. That feature was untested.

index.js Outdated
@@ -22,31 +21,38 @@ export default async function getStream(inputStream, options = {}) {

const stream = new PassThroughStream({highWaterMark: maxHighWaterMark, encoding: isBuffer ? undefined : encoding});

await streamPipeline(inputStream, stream);
const newStream = compose(inputStream, stream);
Copy link
Collaborator Author

@ehmicky ehmicky Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of #62.
This is needed because the exception would otherwise be thrown from await streamPipeline().

@sindresorhus
Copy link
Owner

Can you fix the conflict?

@ehmicky
Copy link
Collaborator Author

ehmicky commented Aug 7, 2023

Done 👍

@sindresorhus sindresorhus merged commit 4e36f67 into sindresorhus:main Aug 7, 2023
3 checks passed
@ehmicky ehmicky deleted the error-buffered-data branch August 7, 2023 16:47
@ehmicky ehmicky mentioned this pull request Aug 13, 2023
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.

error.bufferedData is missing in 7.0.0 (except on maxBuffer error)
2 participants