diff --git a/CHANGELOG.md b/CHANGELOG.md index 9439a1d..9739048 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - added manpage - added completion for elvish +### Library +- added Clone derive + ## [0.3.0] - 2022-01-28 ### CLI - SimpleLogger init error handling diff --git a/Cargo.toml b/Cargo.toml index 6cfa38e..0b86431 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,5 +58,3 @@ features = ["json", "rustls-tls"] [dependencies.tokio] version = "1.17.0" features = ["macros", "rt-multi-thread"] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/cli/upload_image.rs b/src/cli/upload_image.rs index 3a168c1..aa5d82e 100644 --- a/src/cli/upload_image.rs +++ b/src/cli/upload_image.rs @@ -29,7 +29,13 @@ pub async fn upload_image(client: ImgurClient, path: &str) { panic!("{path} is not a url") } - let i = upload_img(client, &image).await.expect("send api request"); + let i = upload_img(client, &image).await.unwrap_or_else(|err| { + notify!(Notification::new() + .summary("Error!") + .body(&format!("Error: {}", &err.to_string())) + .appname("Imgurs")); // I don't think you can set it to error + panic!("{}", err) + }); print_image_info(i.clone()); let body = format!("Uploaded {}", i.data.link);