Skip to content

Commit

Permalink
fix: output friendly error on unknown command
Browse files Browse the repository at this point in the history
  • Loading branch information
gjvis committed May 26, 2017
1 parent 0c91c59 commit 0d44512
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var errors = {
policyFile: 'Bad policy file, please use --path=PATH to specify a ' +
'directory with a .snyk file',
idRequired: 'id is a required field for `snyk ignore`',
unknownCommand: '%s\n\nRun `snyk --help` for a list of available commands.',
};

// a key/value pair of error.code (or error.message) as the key, and our nice
Expand All @@ -53,6 +54,7 @@ var codes = {
NO_API_TOKEN: errors.noApiToken,
502: errors.timeout,
504: errors.timeout,
UNKNOWN_COMMAND: errors.unknownCommand,
};

module.exports = function error(command) {
Expand Down

0 comments on commit 0d44512

Please sign in to comment.