mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
pipeToSync() does not fail the writer when endSync() returns -1, so that a caller can still close it asynchronously. A caller that cannot, e.g. because the writer is sync-only and has no end(), would be left with a writer that is neither closed nor failed. Add a failOnIncompleteClose option (a Node.js extension) that fails the writer with the thrown ERR_INVALID_STATE error in that case. preventFail takes precedence over it. Assisted-by: OpenCode Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/66483 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>