Open skyfore opened 6 years ago
I solve it with split code, such as
const fswrap = filepath => new Promise((resolve, reject) => {
const readable = fs.createReadStream(filepath);
const pipistream = readable.pip(unZip.Extract({ path: './' }));
pipistream.on('close', () => resolve());
readable.on('error', e => reject(e));
});
I do not know if it will parameter more problem, but I test can catch error or get right value.
In this case,
./notexistfile
is not exist, and I can't catch error. What should I do if I want to catch error.