Skip to content

fix: guard TypeDef.check_value() against constraint exceptions#98

Merged
rororowyourboat merged 1 commit intodevfrom
fix/86-typedef-check-value
Mar 4, 2026
Merged

fix: guard TypeDef.check_value() against constraint exceptions#98
rororowyourboat merged 1 commit intodevfrom
fix/86-typedef-check-value

Conversation

@rororowyourboat
Copy link
Collaborator

Summary

  • Wrap constraint predicate calls in TypeDef.check_value() with try/except so user-supplied constraints that raise return False instead of crashing verification
  • Also guard ParameterDef.check_value() bounds comparison
  • 3 new tests covering ZeroDivisionError, TypeError, and truthy non-bool returns

Closes #86

Wrap constraint predicate calls in try/except so user-supplied
constraints that raise (e.g., ZeroDivisionError, TypeError) return
False instead of propagating uncaught through verification paths.

Also guard ParameterDef.check_value() bounds comparison.

Closes #86
@rororowyourboat rororowyourboat merged commit 9d02824 into dev Mar 4, 2026
@rororowyourboat rororowyourboat deleted the fix/86-typedef-check-value branch March 4, 2026 10:13
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.

fix: guard TypeDef.check_value() against constraint exceptions

1 participant