Don't propagate errors into Node.js #2926
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
H/t @satabin for reporting in gnieh/fs2-data#335 (comment).
Previously, exceptions encountered in
fs2.Stream
would also be propagated into the Node.js stream it was interopping with. In v3.2.8 this started crashing the Node.js process with:(Note: the
unexpected '1' before object key
is an expected error raised in the fs2-data test suite.)Propagating the error seems sensible, but probably is not the right thing to do.
I think this was an existing bug, that became exposed through the changes in #2918. Specifically in 0c71749 besides replacing the facade I swapped in the
MicrotaskExecutor
forSyncIO
(probably should have done it in another PR :) This introduced a newcede
/yield
due to theevalOn
which gave the error event an opportunity to emit when previously it did not.