From 7295214c1a6ed4c2412c83d046c4d2853a9f3fea Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 26 Mar 2026 07:24:40 +0000 Subject: [PATCH] Handle benchmark errors gracefully instead of panicking Replace `.unwrap()` on `run_benchmark()` result with proper error handling. Previously, when all upsert retries were exhausted (e.g. during chaos testing node kills), the error would propagate to main() and hit `.unwrap()`, producing an ugly panic with stack trace instead of a clean error message and exit code. Made-with: Cursor --- src/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index ddd1ff3..e41c666 100644 --- a/src/main.rs +++ b/src/main.rs @@ -95,8 +95,9 @@ fn main() { .enable_all() .build(); - runtime - .unwrap() - .block_on(run_benchmark(args, stopped)) - .unwrap(); + let runtime = runtime.expect("Failed to create tokio runtime"); + if let Err(err) = runtime.block_on(run_benchmark(args, stopped)) { + eprintln!("Benchmark failed: {err:#}"); + std::process::exit(1); + } }