Skip to content

fix: avoid unnecessary error throwing (rebased from PR #14)#21

Merged
GasStationManager merged 1 commit intomainfrom
pr14-rebase
Mar 7, 2026
Merged

fix: avoid unnecessary error throwing (rebased from PR #14)#21
GasStationManager merged 1 commit intomainfrom
pr14-rebase

Conversation

@GasStationManager
Copy link
Owner

Rebased port of #14 (remove-error-throwing by Paul Lezeau) onto current main.

Changes

  • Logging to stderr: All diagnostic output uses IO.eprintln instead of IO.println, keeping stdout clean for programmatic use
  • Fix typo: environementenvironment
  • No more throw on check failure: runSafeVerify returns (HashMap × Bool) instead of throwing when the solution fails verification. Errors are still thrown for malformed input (missing files, unsafe constants, etc.)
  • JSON always written: --save output is created even when the check fails, making it useful for downstream tooling
  • Verbose hint: Error message suggests -v flag when not already enabled
  • TODO comment: Notes that the safety mismatch branch in printVerboseOpaqueMismatch is currently unreachable

Co-authored-by: Paul Lezeau

Supersedes #14.

Test results

All 12 test cases pass (attacks rejected, benign cases accepted, JSON written on both success and failure).

Port of remove-error-throwing branch onto current main:
- Log to stderr (IO.eprintln) instead of stdout for all diagnostic output
- Fix typo: environement -> environment
- runSafeVerify returns (HashMap × Bool) instead of throwing on check failure
- Axiom violations logged instead of thrown, allowing JSON output to be written
- JSON output always saved when --save is specified (even on failure)
- Add verbose flag hint in error message
- TODO comment on safety mismatch unreachability

Co-authored-by: Paul Lezeau

Supersedes #14.
@GasStationManager GasStationManager merged commit 1c2914e into main Mar 7, 2026
2 checks passed
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.

1 participant