🎨 Improve error messaging
This commit is contained in:
parent
a7d03d3c20
commit
0f72116e30
1 changed files with 2 additions and 2 deletions
|
@ -72,10 +72,10 @@ export default function parseArguments(spec: { [key: string]: IOption }): { fail
|
||||||
const verifyFunc = spec[argumentOption].verify;
|
const verifyFunc = spec[argumentOption].verify;
|
||||||
try {
|
try {
|
||||||
if (verifyFunc !== undefined && !verifyFunc(argumentValue)) {
|
if (verifyFunc !== undefined && !verifyFunc(argumentValue)) {
|
||||||
failFunction(`the argument "${argumentOption}" has an invalid value "${argumentValue}"`);
|
failFunction(`Invalid value set for option "${argumentOption}": "${argumentValue}".`);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
failFunction(`Error during verification; the argument "${argumentOption}" has an invalid value "${argumentValue}"`);
|
failFunction(`Invalid value set for option "${argumentOption}", the validation of "${argumentValue}" failed: ${String(error)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Remember the value, and if it is a required argument, mark that we have encountered it
|
//Remember the value, and if it is a required argument, mark that we have encountered it
|
||||||
|
|
Loading…
Reference in a new issue