| 526 | |
| 527 | |
| 528 | class LogicChecker: |
| 529 | def __init__(self, logic: Callable) -> None: |
| 530 | self.logic = logic |
| 531 | |
| 532 | def __call__(self): |
| 533 | try: |
| 534 | self.logic() |
| 535 | except Exception as exception: |
| 536 | self.exception = exception |
| 537 | return False |
| 538 | return True |
| 539 | |
| 540 | def provide_information_on_failure(self): |
| 541 | return self.exception |
| 542 | |
| 543 | |
| 544 | @dataclass(frozen=True) |