From b406f1d5a4725c1d234482a57effa0b5bccc6485 Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Thu, 5 Jan 2023 23:53:12 +0800 Subject: [PATCH] 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. --- Userland/Applications/PDFViewer/PDFViewerWidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp index 75c507c562..f2231e2073 100644 --- a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp +++ b/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()); } }