Skip to content

Commit

Permalink
fix(validation): Use the error as a message when none exists otherwise (
Browse files Browse the repository at this point in the history
  • Loading branch information
softcraft-development authored and evocateur committed Jan 11, 2019
1 parent 27bf739 commit 0510fe6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yargs.js
Expand Up @@ -1152,7 +1152,7 @@ function Yargs (processArgs, cwd, parentRequire) {
}

self._runValidation = function runValidation (argv, aliases, positionalMap, parseErrors) {
if (parseErrors) throw new YError(parseErrors.message)
if (parseErrors) throw new YError(parseErrors.message || parseErrors)
validation.nonOptionCount(argv)
validation.requiredArguments(argv)
if (strict) validation.unknownArguments(argv, aliases, positionalMap)
Expand Down

0 comments on commit 0510fe6

Please sign in to comment.