floatdrop / gulp-plumber

Fixing Node pipes
MIT License
806 stars 32 forks source link

[Question] error handling Boolean vs function #64

Open phoshenwen opened 3 years ago

phoshenwen commented 3 years ago

Could someone please explain to me the difference between using the default true Boolean for the error hander, versus using something like:

    .pipe(
        plumber({
            errorHandler: function (err) {
                console.log(err);
                this.emit('end');
            },
        }),
    )

which attaches the function to stream on('error') ? The only difference in the package that I can see is that the above includes this.emit('end').

Thank you.