Skip to content

Comments

fix(cli): replace process::exit with error return for --max-weight#155

Closed
rocketman-code wants to merge 1 commit intomainfrom
fix/max-weight-error-handling
Closed

fix(cli): replace process::exit with error return for --max-weight#155
rocketman-code wants to merge 1 commit intomainfrom
fix/max-weight-error-handling

Conversation

@rocketman-code
Copy link
Owner

Closes #148

Summary

  • Add MaxWeightExceeded variant to Error enum with structured fields (kind, weight, module_count, threshold)
  • Replace process::exit(1) in run_trace with Err(Error::MaxWeightExceeded { .. }) so the error flows through the centralized error handler in main()
  • The Display impl formats the same user-facing message as before, so CLI output is unchanged

Test plan

  • cargo test --workspace passes (all 338 tests)
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --check clean

@rocketman-code
Copy link
Owner Author

Closing: patch contents already on main. Branch has zero diff after rebase.

@rocketman-code rocketman-code deleted the fix/max-weight-error-handling branch February 22, 2026 23:31
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(cli): --max-weight threshold error prints twice

1 participant