Skip to content

Commit

Permalink
chore: improve error toast messages
Browse files Browse the repository at this point in the history
  • Loading branch information
flxzt committed Sep 21, 2024
1 parent fec95e7 commit c98106f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/rnote-ui/src/dialogs/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,13 @@ pub(crate) async fn dialog_export_doc_w_prefs(appwindow: &RnAppWindow, canvas: &
p.path())
.and_then(|p| p.into_os_string().into_string().ok()) else {
error!("Failed to get the parent folder of the output file `{file:?}.");
appwindow.overlays().dispatch_toast_error(&gettext("Exporting document failed"));
appwindow.overlays().dispatch_toast_error(&gettext("Failed to view the file in the file manager"));
return;
};

if let Err(e) = open::that(&folder_path_string) {
error!("Opening the parent folder '{folder_path_string}' in the file manager failed, Err: {e:?}");
appwindow.overlays().dispatch_toast_error(&gettext("Failed to open the file in the file manager"));
appwindow.overlays().dispatch_toast_error(&gettext("Failed to view the file in the file manager"));
}
}
), crate::overlays::TEXT_TOAST_TIMEOUT_DEFAULT);
Expand Down Expand Up @@ -712,13 +712,13 @@ pub(crate) async fn dialog_export_doc_pages_w_prefs(appwindow: &RnAppWindow, can
clone!(#[weak] appwindow, move |_reload_toast| {
let Some(folder_path_string) = dir.path().and_then(|p| p.into_os_string().into_string().ok()) else {
error!("Failed to get the path of the parent folder");
appwindow.overlays().dispatch_toast_error(&gettext("Exporting document failed"));
appwindow.overlays().dispatch_toast_error(&gettext("Failed to view the file in the file manager"));
return;
};

if let Err(e) = open::that(&folder_path_string) {
error!("Opening the parent folder '{folder_path_string}' in the file manager failed, Err: {e:?}");
appwindow.overlays().dispatch_toast_error(&gettext("Failed to open the file in the file manager"));
appwindow.overlays().dispatch_toast_error(&gettext("Failed to view the file in the file manager"));
}
}
), crate::overlays::TEXT_TOAST_TIMEOUT_DEFAULT);
Expand Down Expand Up @@ -1069,13 +1069,13 @@ pub(crate) async fn dialog_export_selection_w_prefs(appwindow: &RnAppWindow, can
p.path())
.and_then(|p| p.into_os_string().into_string().ok()) else {
error!("Failed to get the parent folder of the output file `{file:?}.");
appwindow.overlays().dispatch_toast_error(&gettext("Exporting document failed"));
appwindow.overlays().dispatch_toast_error(&gettext("Failed to view the file in the file manager"));
return;
};

if let Err(e) = open::that(&folder_path_string) {
error!("Opening the parent folder '{folder_path_string}' in the file manager failed, Err: {e:?}");
appwindow.overlays().dispatch_toast_error(&gettext("Failed to open the file in the file manager"));
appwindow.overlays().dispatch_toast_error(&gettext("Failed to view the file in the file manager"));
}
}),
crate::overlays::TEXT_TOAST_TIMEOUT_DEFAULT,
Expand Down

0 comments on commit c98106f

Please sign in to comment.