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.
This commit is contained in:
parent
263348ff2d
commit
a0ba21e442
Notes:
sideshowbarker
2024-07-17 21:02:17 +09:00
Author: https://github.com/metmo Commit: https://github.com/SerenityOS/serenity/commit/a0ba21e4427 Pull-request: https://github.com/SerenityOS/serenity/pull/11836
1 changed files with 3 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue