From 815dfec9adb286ab6d72a928ba5bdfb2b143618c Mon Sep 17 00:00:00 2001 From: WanGe2000 <1242374449@qq.com> Date: Thu, 7 Sep 2023 12:26:20 +0800 Subject: [PATCH] fix: #103 catch error in write stream --- node_stream_zip.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node_stream_zip.js b/node_stream_zip.js index d95bbef..a4cd2f5 100644 --- a/node_stream_zip.js +++ b/node_stream_zip.js @@ -516,6 +516,9 @@ const StreamZip = function (config) { return; } fsStm = fs.createWriteStream(outPath, { fd: fdFile }); + fsStm.on('error',(err)=>{ + callback(err); + }) fsStm.on('finish', () => { that.emit('extract', entry, outPath); if (!errThrown) {