added error dialog

This commit is contained in:
Piyush मिश्रः 2022-01-14 16:44:01 +05:30
parent fd6619f2f7
commit 5b71bdbee6
1 changed files with 4 additions and 2 deletions

View File

@ -168,7 +168,9 @@ impl ImageContainer {
.unwrap(), .unwrap(),
); );
fs::write(&path_conf, serde_json::to_string(&*prop).unwrap()).unwrap(); if let Err(_) = fs::write(&path_conf, serde_json::to_string(&*prop).unwrap()) {
dialog::message_default("Failed to save conf!");
}
let mut img = image::open(&path_original).unwrap(); let mut img = image::open(&path_original).unwrap();
let (width, height): (f64, f64) = Coord::from(img.dimensions()).into(); let (width, height): (f64, f64) = Coord::from(img.dimensions()).into();
@ -192,7 +194,7 @@ impl ImageContainer {
); );
if let Err(_) = img.save_with_format(&export, image::ImageFormat::Png) { if let Err(_) = img.save_with_format(&export, image::ImageFormat::Png) {
dialog::message_default("Failed to save!"); dialog::message_default("Failed to export png!");
} }
} }
} }