瀏覽代碼

PDFViewer: Inform users of underlying issue when loading document

While this is not super useful to end users, it's still better than the
simpler, generic "failed to load" error message.
Rodrigo Tobar 2 年之前
父節點
當前提交
b406f1d5a4
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Userland/Applications/PDFViewer/PDFViewerWidget.cpp

+ 2 - 1
Userland/Applications/PDFViewer/PDFViewerWidget.cpp

@@ -355,7 +355,8 @@ void PDFViewerWidget::open_file(Core::File& file)
     if (maybe_error.is_error()) {
         auto error = maybe_error.release_error();
         warnln("{}", error.message());
-        GUI::MessageBox::show_error(nullptr, "Failed to load the document."sv);
+        auto user_error_message = DeprecatedString::formatted("Failed to load the document. Error:\n{}.", error.message());
+        GUI::MessageBox::show_error(nullptr, user_error_message.view());
     }
 }