ElyPDF: an OS permission error shows as an error, never a missing text key (P-01); component library f834f55

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 10:58:47 -04:00
1 parent ab85673eea
commit 943411fb1a
17 files changed
+90 -25

No files matched your search

+3 -3
View File
@@ -227,10 +227,10 @@ impl PdfView {
pub fn fail(&self, what: &str, error: &io::Error, cx: &mut Context<Self>) {
// Engine text may quote the document: the user sees it.
log::error!("pdf: {what} failed ({:?})", error.kind());
let text = match error.kind() {
let text = match ely_pdf_engine::refused(error) {
_ if ely_pdf_engine::is_stale(error) => ely_ui::i18n::text(cx, "pdf.object.changed", &[]),
io::ErrorKind::PermissionDenied => restricted(&error.to_string(), cx),
_ => ely_ui::i18n::text(cx, "pdf.failed", &[("what", what), ("error", &error.to_string())]),
Some(needed) => restricted(needed, cx),
None => ely_ui::i18n::text(cx, "pdf.failed", &[("what", what), ("error", &error.to_string())]),
};
cx.emit(Failed(text.to_string()));
}