anzip
                                
                                 anzip copied to clipboard
                                
                                    anzip copied to clipboard
                            
                            
                            
                        bug: Uncaught promise error while using entryHandler
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
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}`);
    }
Environnement
Node version 14.7.0 Windows 10
Thanks :)
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
Thanks @jscti I will investigate.