Skip to content

Commit

Permalink
fix: improve error handling in main function
Browse files Browse the repository at this point in the history
- Replace unwrap() with some error handling
- Print user-friendly error message
- Set exit code on failure

This change makes the tool more user-friendly by providing error messages instead of panicking.
  • Loading branch information
grainme committed Jan 24, 2025
1 parent 853de7a commit f536d5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,11 @@ fn main() {
.enable_all()
.build()
.unwrap();
rt.block_on(run()).unwrap();

if let Err(e) = rt.block_on(run()) {
eprintln!("Error: {}", e);
std::process::exit(1);
}
}

enum WorkMode {
Expand Down

0 comments on commit f536d5e

Please sign in to comment.