tools.js
function catchErrors() {
  // don't use an arrow function, we need the `this` instance!
  return plumber(function(err) {
    if (!err.plugin) {
      err.plugin = 'gulp-task-maker'
    }
    showError(err)
    // keep watch tasks running
    if (this && typeof this.emit === 'function') {
      this.emit('end')
    }
  })
}
function catchErrors() {
  // don't use an arrow function, we need the `this` instance!
  return plumber(function(err) {
    if (!err.plugin) {
      err.plugin = 'gulp-task-maker'
    }
    showError(err)
    // keep watch tasks running
    if (this && typeof this.emit === 'function') {
      this.emit('end')
    }
  })
}
function catchErrors ( ) { // don't use an arrow function, we need the `this` instance! return plumber ( function ( err ) { if ( ! err . plugin ) { err . plugin = 'gulp-task-maker' } showError ( err ) // keep watch tasks running if ( this && typeof this . emit === 'function' ) { this . emit ( 'end' ) } } ) }
gulp-plumber with our custom error handler
@return {*}
gulp - plumber with our custom error handler