3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Better config validator error message for missing properties

This commit is contained in:
Dragory 2019-07-22 13:50:41 +03:00
parent ee58769460
commit c2935bd1d7

View file

@ -35,7 +35,10 @@ const report = fold((errors: any) => {
return errors.map(err => {
if (err.message) return err.message;
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);