Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return rule name as part of error in rule evaluation #425

Open
vivlis opened this issue Dec 7, 2023 · 0 comments
Open

Return rule name as part of error in rule evaluation #425

vivlis opened this issue Dec 7, 2023 · 0 comments

Comments

@vivlis
Copy link

vivlis commented Dec 7, 2023

I would like to propose change for error rule execution, so that outgoing error contains rule name. At the moment rule name with error is logged:
log.Errorf("Failed testing condition for rule : %s. Got error %v", ruleEntry.RuleName, err)
but not returned back from func,

log.Errorf("Failed testing condition for rule : %s. Got error %v", ruleEntry.RuleName, err)
if g.ReturnErrOnFailedRuleEvaluation {
return err
}

proposed:
err = fmt.Errorf("Failed testing condition for rule : %s. Got error %v", ruleEntry.RuleName, err)
log.Error(err)
if g.ReturnErrOnFailedRuleEvaluation {

					return err
				}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant