summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorMarcus Nilsson <brainbomb@gmail.com>2022-01-12 18:02:11 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-12 19:44:17 +0100
commita0ba21e44271a12a08047af90913bac3eda77434 (patch)
tree45d6376f982a602077d46504ec629b40cfdd7ba6 /Userland
parent263348ff2d5877ad5f1008f6ca5a6f44a87f2c13 (diff)
downloadserenity-a0ba21e44271a12a08047af90913bac3eda77434.zip
LibGUI: Print error when failing to load thumbnail in FileSystemModel
If a thumbnail cannot load it's a good opportunity to print out the error message. On top of that, we still want to update m_thumbnail_progress so that the progress bar doesn't get stuck instead of returning early from the lambda.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGUI/FileSystemModel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp
index e74f90bceb..89840db8b2 100644
--- a/Userland/Libraries/LibGUI/FileSystemModel.cpp
+++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp
@@ -657,9 +657,10 @@ bool FileSystemModel::fetch_thumbnail_for(Node const& node)
[this, path, weak_this](auto thumbnail_or_error) {
if (thumbnail_or_error.is_error()) {
s_thumbnail_cache.set(path, nullptr);
- return;
+ dbgln("Failed to load thumbnail for {}: {}", path, thumbnail_or_error.error());
+ } else {
+ s_thumbnail_cache.set(path, thumbnail_or_error.release_value());
}
- s_thumbnail_cache.set(path, thumbnail_or_error.release_value());
// The model was destroyed, no need to update
// progress or call any event handlers.