title: gulp error handling for dependent task
body: <p>Please find the content of the <code>gulpfile.js</code> as below.</p>
  
  <p>The task <code>uglify</code> depends on the task <code>jshint</code>. Currently when I run <code>gulp</code>, both the tasks get executed, irrespective of the outcome of the <code>jshint</code> task. I don't want the <code>uglify</code> task to get executed when there are 'jshint' error(s).</p>
  
  <p>In other words, when ever there are dependent tasks, I don't want the subsequent tasks to get executed, if there are error detected by the preceding task.</p>
  
  <p>Is it possible in <code>gulp</code>?</p>
  
  <pre><code>var gulp = require('gulp');
  var jshint = require('gulp-jshint');
  var uglify = require('gulp-uglify');
  
  gulp.task('jshint', function () {
    return gulp.src(['assets/js/**/*.js'])
      .pipe(jshint('.jshintrc'))
      .pipe(jshint.reporter('jshint-stylish'));
  });
  
  gulp.task('uglify', ['jshint'], function() {
    return gulp.src('assets/js/**/*.js')
      .pipe(uglify())
      .pipe(gulp.dest('assets-min/js/'));
  });
  
  gulp.task('default', ['jshint', 'uglify']);
  </code></pre>
  
  <p>Please refer the below <code>console output - not desired</code>. Though there had been <code>jshint</code> error, the <code>uglify</code> task ran successfully.</p>
  
  <p>I have also created a GitHub repository with the boilerplate code for the above mentioned.
  Please find the same at <a href="https://github.com/sarbbottam/gulp-workflow" rel="noreferrer">@sarbbottam/gulp-workflow</a>.</p>
  
  <p><strong>Console out of the undesired workflow</strong>
  <img src="https://i.stack.imgur.com/M5QHD.png" alt="console output - not desired"></p>
  
  <p><strong>Console out of the expected workflow</strong>
  <img src="https://i.stack.imgur.com/A2M4m.png" alt="console output - expected"></p>