Skip to content

Commit

Permalink
feat: Attach properties to missing task error (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Mar 22, 2024
1 parent e255fc7 commit 989d9e9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/helpers/normalizeArgs.js
Expand Up @@ -13,11 +13,16 @@ function normalizeArgs(registry, args) {
var fn = registry.get(task);
if (!fn) {
var similar = similarTasks(registry, task);
var err;
if (similar.length > 0) {
assert(false, 'Task never defined: ' + task + ' - did you mean? ' + similar.join(', '));
err = new Error('Task never defined: ' + task + ' - did you mean? ' + similar.join(', '));
err.task = task;
err.similar = similar;
} else {
assert(false, 'Task never defined: ' + task);
err = new Error('Task never defined: ' + task);
err.task = task;
}
throw err;
}
return fn;
}
Expand Down

0 comments on commit 989d9e9

Please sign in to comment.