title: Gulp 4: how to detect the "Did you forget to signal async completion?" error in a complex build script
body: <p>As people who have migrated to Gulp 4 may know, <code>gulp.series</code> – as it should – won't proceed with execution if a task in the series doesn't signal completion properly.</p>
  
  <p>My problem with that is the way it handles this kind of error – it's simply a message in the console <em>(Did you forget to signal async completion?)</em>; gulp still exits with an error code of 0. That means that if you run gulp inside a more complicated build script, to that script it will look like if everything was alright and gulp tasks completed successfully when they clearly didn't. (In contrast, if you throw an error with <code>gulpUtil.plugin error</code>, it results in a non-0 error code.)</p>
  
  <p>So my question is: how would you detect "from the outside" that such error have happened?</p>
  
  <ul>
  <li>Is there a way to make gulp exit with a non-0 in this case? (Is there an event I can subscribe to and throw an error, or a config I can set etc.)</li>
  <li>Should I just try to check if the assets that should have been generated exist? (I find this solution very fragile.)</li>
  <li>Should I "watch" the console messages and look for specific strings like "Did you forget to signal..."? (Ugh!)</li>
  <li>(Yes, I know I could do everything with a gulp and then I wouldn't need to check the error code, but let's just assume that, in reality, I can't.)</li>
  </ul>
  
  <p>Is there any other possibility I didn't think of?</p>