gulpjs / undertaker

Task registry that allows composition through series/parallel methods.
MIT License
200 stars 31 forks source link

Added new assert error on task execution chain #82

Closed danielpanero closed 6 years ago

danielpanero commented 6 years ago

When you use old task execution system now it throws an error.... Before it was totally vague.

Example

var Undertaker = require('./index');

var taker = new Undertaker();

taker.task('task1', function(cb){
  // do things

  cb(); // when everything is done
});

taker.task('task2', function(){
  return fs.createReadStream('./myFile.js')
    .pipe(fs.createWriteStream('./myFile.copy.js'));
});

taker.task('combined', ['task1', 'task2']);

Before:

assert.js:42
  throw new errors.AssertionError({
  ^

AssertionError [ERR_ASSERTION]: Task function must be specified
    at Undertaker.set [as _setTask] (C:\Users\danie\Google Drive\Projects WebSites\undertaker\lib\set-task.js:11:3)
    at Undertaker.task (C:\Users\danie\Google Drive\Projects WebSites\undertaker\lib\task.js:13:8)
    at Object.<anonymous> (C:\Users\danie\Google Drive\Projects WebSites\undertaker\example.js:16:7)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Function.Module.runMain (module.js:701:10)
    at startup (bootstrap_node.js:190:16)

Now:

assert.js:42
  throw new errors.AssertionError({
  ^

AssertionError [ERR_ASSERTION]: Wrong Concatenetion! Check out the new task execution system: https://fettblog.eu/gulp-4-parallel-and-series/
    at Undertaker.set [as _setTask] (C:\Users\danie\Google Drive\Projects WebSites\undertaker\lib\set-task.js:11:12)
    at Undertaker.task (C:\Users\danie\Google Drive\Projects WebSites\undertaker\lib\task.js:13:8)
    at Object.<anonymous> (C:\Users\danie\Google Drive\Projects WebSites\undertaker\example.js:17:7)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Function.Module.runMain (module.js:701:10)
    at startup (bootstrap_node.js:190:16)
phated commented 6 years ago

No.

danielpanero commented 6 years ago

Why not?