summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Tobar <rtobarc@gmail.com>2023-01-05 23:53:12 +0800
committerAndreas Kling <kling@serenityos.org>2023-01-06 18:06:41 +0100
commitb406f1d5a4725c1d234482a57effa0b5bccc6485 (patch)
tree04a24b20fbfd045b5a3d3509824496bb0fa5ec6c
parentb10fe7c1365c917ec11e998efc4354f196331fb5 (diff)
downloadserenity-b406f1d5a4725c1d234482a57effa0b5bccc6485.zip
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.
-rw-r--r--Userland/Applications/PDFViewer/PDFViewerWidget.cpp3
1 files changed, 2 insertions, 1 deletions
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());
}
}