policies: set message instead of error for Event
This commit is contained in:
parent
3cc92f6c97
commit
1c686e19b5
|
@ -76,11 +76,11 @@ class PolicyProcess(Process):
|
||||||
try:
|
try:
|
||||||
policy_result = self.binding.policy.passes(self.request)
|
policy_result = self.binding.policy.passes(self.request)
|
||||||
if self.binding.policy.execution_logging:
|
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:
|
except PolicyException as exc:
|
||||||
# Create policy exception event
|
# Create policy exception event
|
||||||
error_string = "".join(format_tb(exc.__traceback__)) + str(exc)
|
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)
|
LOGGER.debug("P_ENG(proc): error", exc=exc)
|
||||||
policy_result = PolicyResult(False, str(exc))
|
policy_result = PolicyResult(False, str(exc))
|
||||||
policy_result.source_policy = self.binding.policy
|
policy_result.source_policy = self.binding.policy
|
||||||
|
|
|
@ -95,7 +95,7 @@ export class EventInfo extends LitElement {
|
||||||
return html`<div class="pf-l-flex">
|
return html`<div class="pf-l-flex">
|
||||||
<div class="pf-l-flex__item">
|
<div class="pf-l-flex__item">
|
||||||
<h3>${gettext("Exception")}</h3>
|
<h3>${gettext("Exception")}</h3>
|
||||||
<code>${this.event.context.error}</code>
|
<code>${this.event.context.error || this.event.context.message}</code>
|
||||||
</div>
|
</div>
|
||||||
<div class="pf-l-flex__item">
|
<div class="pf-l-flex__item">
|
||||||
<h3>${gettext("Expression")}</h3>
|
<h3>${gettext("Expression")}</h3>
|
||||||
|
|
Reference in New Issue