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

Uncatchable errors #41

Open
vdanika opened this issue Sep 26, 2021 · 2 comments
Open

Uncatchable errors #41

vdanika opened this issue Sep 26, 2021 · 2 comments

Comments

@vdanika
Copy link

vdanika commented Sep 26, 2021

Entries are created in stream, can't find any way to subscribe on entry errors before UnzipStream.prototype._prepareOutStream function call. So every error emitted in this function throws exception.

When I got a bad zip to unzip, the app crashes, and there is no option to catch the error (except catching all global exceptions).

In the following app, I expect to get an error callback, but it get an exception: (events.js:291: "throw er; // Unhandled 'error' event") :

require("fs").createReadStream('bad.zip').pipe(require("unzip-stream") .Extract({ path: 'output' })) .on('error', (err)=>{ console.log(err); }).on("close", ()=>{ console.log("on closeed"); });
bad.zip

@vdanika
Copy link
Author

vdanika commented Sep 26, 2021

I found the Update unzip-stream.js pull request. It solves the problem.

@mickeyjohn
Copy link

Hi @vdanika,
It should be fixed by this pull request

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

No branches or pull requests

2 participants