mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
Better config validator error message for missing properties
This commit is contained in:
parent
ee58769460
commit
c2935bd1d7
1 changed files with 4 additions and 1 deletions
|
@ -35,7 +35,10 @@ const report = fold((errors: any) => {
|
||||||
return errors.map(err => {
|
return errors.map(err => {
|
||||||
if (err.message) return err.message;
|
if (err.message) return err.message;
|
||||||
const context = err.context.map(c => c.key).filter(k => k && !k.startsWith("{"));
|
const context = err.context.map(c => c.key).filter(k => k && !k.startsWith("{"));
|
||||||
return `Invalid value <${stringify(err.value)}> supplied to <${context.join("/")}>`;
|
const value = stringify(err.value);
|
||||||
|
return value === undefined
|
||||||
|
? `<${context.join("/")}> is required`
|
||||||
|
: `Invalid value <${stringify(err.value)}> supplied to <${context.join("/")}>`;
|
||||||
});
|
});
|
||||||
}, noop);
|
}, noop);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue