We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi there, a little bug on your lib :
Throwing an error in entryHandler result on an UnhandledPromiseRejectionWarning + impossibility to catch it
Should forward error normally
Swallow error
const entryHandler = async entry => { try { // unziping file to location await entry.saveTo(outputPath); return false; } catch (err) { // HERE => UnhandledPromiseRejectionWarning: throw new Error(`Error while unziping file "${entry.name}" : ${err}`); } }; try { await anzip(file, { pattern: /.*/, entryHandler, disableSave: true, disableOutput: true }); } catch (err) { // HERE => should be able to catch the entryHandler error here throw new Error(`Error handling "${file}" : ${err}`); }
Node version 14.7.0 Windows 10
Thanks :)
The text was updated successfully, but these errors were encountered:
And more than that, entryHandle seems not to be "awaited" correctly :
console.log('start'); let count = 0; const entryHandler = async entry => { try { // unziping file to location await entry.saveTo(outputPath); count++; console.log('count', count); return false; } catch (err) { // HERE => UnhandledPromiseRejectionWarning: throw new Error(`Error while unziping file "${entry.name}" : ${err}`); } }; try { await anzip(file, { pattern: /.*/, entryHandler, disableSave: true, disableOutput: true }); console.log('finish'); } catch (err) { // HERE => should be able to catch the entryHandler error here throw new Error(`Error handling "${file}" : ${err}`); }
will output :
start count 1 count 2 finish count 3
which is not correct
Sorry, something went wrong.
Thanks @jscti I will investigate.
mikbry
No branches or pull requests
Hi there, a little bug on your lib :
Description
Throwing an error in entryHandler result on an UnhandledPromiseRejectionWarning + impossibility to catch it
Expected behaviour
Should forward error normally
Actual behaviour
Swallow error
Steps to reproduce
Environnement
Node version 14.7.0
Windows 10
Thanks :)
The text was updated successfully, but these errors were encountered: