1
0
Fork 0

fix(rule): print failure message when errors are present

This commit is contained in:
ssube 2019-10-28 22:06:58 -05:00
parent 3291e0408e
commit 5160eaa93d
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 1 additions and 1 deletions

View File

@ -191,7 +191,7 @@ export async function visitRules(ctx: VisitorContext, rules: Array<Rule>, data:
const itemCopy = cloneDeep(item);
const itemResult = await rule.visit(ctx, itemCopy);
if (itemResult.errors.length === 0) {
if (itemResult.errors.length > 0) {
ctx.logger.warn({ count: itemResult.errors.length, rule }, 'rule failed');
ctx.mergeResult(itemResult);
continue;