Skip to content

Fix AttributeError in demo.py when handling PolicyViolation#46

Open
Anshulrajkumar wants to merge 1 commit into
OWASP:mainfrom
Anshulrajkumar:fix/45-demo-policyviolation-attr
Open

Fix AttributeError in demo.py when handling PolicyViolation#46
Anshulrajkumar wants to merge 1 commit into
OWASP:mainfrom
Anshulrajkumar:fix/45-demo-policyviolation-attr

Conversation

@Anshulrajkumar

@Anshulrajkumar Anshulrajkumar commented Jun 21, 2026

Copy link
Copy Markdown

Summary

This PR fixes an AttributeError in demo.py when handling PolicyViolation.

The demo script references exc.detector, but the PolicyViolation exception exposes the triggered policy through exc.rule.

Replacing exc.detector with exc.rule restores the expected demo behavior.

Fixes #45

Type of change

  • Bug fix
  • New feature / detector / policy primitive
  • Framework or backend adapter
  • Documentation

Testing

  • Ran demo.py before the change and reproduced the AttributeError.
  • Updated the exception handler to use exc.rule.
  • Ran demo.py again and verified the demo completes successfully.

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

Successfully merging this pull request may close these issues.

[bug] demo.py references PolicyViolation.detector which does not exist

1 participant