Skip to content

Commit

Permalink
Add error handling for CLI errors (#34)
Browse files Browse the repository at this point in the history
Add error message when an error occurs
  • Loading branch information
ykdy3951 authored Mar 5, 2024
1 parent 6e397cc commit 73da5bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ async fn main() {
// Parse the command line arguments
let cli = Cli::parse();

if let Err(_error) = handle_command(cli.commands).await {}
if let Err(_error) = handle_command(cli.commands).await {
println!("\n\nError Occurred\n{}", _error.to_string());

Check warning on line 41 in src/main.rs

View workflow job for this annotation

GitHub Actions / Clippy Output

`to_string` applied to a type that implements `Display` in `println!` args

warning: `to_string` applied to a type that implements `Display` in `println!` args --> src/main.rs:41:50 | 41 | println!("\n\nError Occurred\n{}", _error.to_string()); | ^^^^^^^^^^^^ help: remove this | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args = note: `#[warn(clippy::to_string_in_format_args)]` on by default
}
}

0 comments on commit 73da5bb

Please sign in to comment.