policies: set message instead of error for Event

This commit is contained in:
Jens Langhammer 2021-01-14 20:17:21 +01:00
parent 3cc92f6c97
commit 1c686e19b5
2 changed files with 3 additions and 3 deletions

View File

@ -76,11 +76,11 @@ class PolicyProcess(Process):
try:
policy_result = self.binding.policy.passes(self.request)
if self.binding.policy.execution_logging:
self.create_event(EventAction.POLICY_EXECUTION, result=policy_result)
self.create_event(EventAction.POLICY_EXECUTION, message="Policy Execution", result=policy_result)
except PolicyException as exc:
# Create policy exception event
error_string = "".join(format_tb(exc.__traceback__)) + str(exc)
self.create_event(EventAction.POLICY_EXCEPTION, error=error_string)
self.create_event(EventAction.POLICY_EXCEPTION, message=error_string)
LOGGER.debug("P_ENG(proc): error", exc=exc)
policy_result = PolicyResult(False, str(exc))
policy_result.source_policy = self.binding.policy

View File

@ -95,7 +95,7 @@ export class EventInfo extends LitElement {
return html`<div class="pf-l-flex">
<div class="pf-l-flex__item">
<h3>${gettext("Exception")}</h3>
<code>${this.event.context.error}</code>
<code>${this.event.context.error || this.event.context.message}</code>
</div>
<div class="pf-l-flex__item">
<h3>${gettext("Expression")}</h3>