<commit_before>
module.exports = function(gulp) {

  gulp.task('images', function() {
    var gutil = gulp.plugin.util,
        prod  = gutil.env.prod,
        imgFilter = gulp.plugin.filter('**/*.{png,gif,jpg,jpeg}'),
        svgFilter = gulp.plugin.filter('**/*.svg');

    return gulp.src('./src/img/**/*.{png,gif,jpg,jpeg,svg}')
      .pipe( gulp.plugin.plumber() )
      .pipe( prod ? gutil.noop() : gulp.plugin.changed('./dev/img/') )

      .pipe( imgFilter )
      .pipe( !prod ? gutil.noop() : gulp.plugin.imagemin() )
      .pipe( imgFilter.restore() )

      .pipe( svgFilter )
      .pipe( !prod ? gutil.noop() : gulp.plugin.svgmin() )
      .pipe( svgFilter.restore() )

      .pipe( gulp.dest(prod ? './dist/img/' : './dev/img/') )
      .pipe( prod ? gutil.noop() : gulp.plugin.connect.reload() );
  });

};<commit_msg>Better error handling for image task<commit_after>
module.exports = function(gulp) {

  gulp.task('images', function() {
    var gutil = gulp.plugin.util,
        prod  = gutil.env.prod,
        imgFilter = gulp.plugin.filter('**/*.{png,gif,jpg,jpeg}'),
        svgFilter = gulp.plugin.filter('**/*.svg');

    return gulp.src('./src/img/**/*.{png,gif,jpg,jpeg,svg}')
      .pipe( gulp.plugin.plumber() )
      .pipe( prod ? gutil.noop() : gulp.plugin.changed('./dev/img/') )

      .pipe( imgFilter )
      .pipe( !prod ? gutil.noop() : gulp.plugin.imagemin() )
      .on('error', gulp.plugin.notify.onError(function(error){
        return error.message.split('\n').pop();
      }))
      .pipe( imgFilter.restore() )

      .pipe( svgFilter )
      .pipe( !prod ? gutil.noop() : gulp.plugin.svgmin() )
      .on('error', gulp.plugin.notify.onError(function(error){
        return error.message.split('\n').pop();
      }))
      .pipe( svgFilter.restore() )

      .pipe( gulp.dest(prod ? './dist/img/' : './dev/img/') )
      .pipe( prod ? gutil.noop() : gulp.plugin.connect.reload() );
  });

};
{'fraction_non_alphanumeric': 0.21624418003103985, 'fraction_numerical': 0.0, 'mean_word_length': 2.5291970802919708, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3463080', 'n_tokens_mistral': 717, 'n_tokens_neox': 689, 'n_words': 105}