Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Attach properties to missing task error #102

Merged
merged 1 commit into from Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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