-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Current Behavior
When --max-weight threshold is exceeded, the error message is printed twice: once from the explicit eprintln! + process::exit(1) in run_trace, and again from the main() error handler which catches the non-zero exit.
Expected Behavior
The error should be printed exactly once.
Context
Duplicate error messages are confusing and look like a bug to users.
Technical Details
Relevant Code
src/main.rs:365-384 — run_trace
if let Some(threshold) = args.max_weight.filter(|&t| report.static_weight_bytes > t) {
eprintln!("error: ... exceeds --max-weight threshold ...");
std::process::exit(1);
}The process::exit(1) bypasses the normal return path. However, since run_trace returns Result<(), Error>, it should return an Err variant instead, letting the main() error handler print once and exit.
Reactions are currently unavailable