Skip to content

Commit 9ffbb2b

Browse files
author
clint
committed
fix catch error
1 parent 3fcb094 commit 9ffbb2b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/main.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,14 +379,9 @@ async fn process_job(job_id: &str, realm_id: u32, first_run: bool) -> Result<()>
379379
let hash_str = hex::encode(hash_result);
380380
println!("Proof SHA256: {}", hash_str.bright_yellow());
381381

382-
let benchmark_time_ms = match fetch_benchmark_time(job_id, realm_id).await {
383-
Ok(time) => time,
384-
Err(e) => {
385-
eprintln!("{} Failed to fetch benchmark time: {}", "⚠".yellow(), e);
386-
// Use a default benchmark time if fetch fails
387-
1337
388-
}
389-
};
382+
let benchmark_time_ms = fetch_benchmark_time(job_id, realm_id)
383+
.await
384+
.map_err(|e| anyhow::anyhow!("Failed to fetch benchmark time: {}", e))?;
390385

391386
print_results(your_time_ms, benchmark_time_ms);
392387

0 commit comments

Comments
 (0)