Skip to content

Commit

Permalink
chore: some more verbosity on error messages when loading assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Almamu committed May 16, 2024
1 parent 13cc080 commit cdfa4ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/WallpaperEngine/Application/CWallpaperApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ void CWallpaperApplication::setupContainer (CCombinedContainer& container, const
container.add (new CDirectory (basepath));
container.addPkg (basepath / "scene.pkg");
container.addPkg (basepath / "gifscene.pkg");
container.add (new CDirectory (this->m_context.settings.general.assets));

try {
container.add (new CDirectory (this->m_context.settings.general.assets));
} catch (CAssetLoadException&) {
sLog.exception("Cannot find a valid assets folder, resolved to ", this->m_context.settings.general.assets);
}

// add two possible patches directories to the container
// hopefully one sticks
Expand Down
2 changes: 1 addition & 1 deletion src/WallpaperEngine/Assets/CCombinedContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void CCombinedContainer::addPkg (const std::filesystem::path& path) {
sLog.out ("No ", path.filename (), " file found at ", path, ". Defaulting to normal folder storage");
} catch (std::runtime_error& ex) {
// the package was found but there was an error loading it (wrong header or something)
sLog.exception ("Failed to load scene.pkg file: ", ex.what ());
sLog.exception ("Failed to load ", path.filename(), " file: ", ex.what ());
}
}

Expand Down

0 comments on commit cdfa4ff

Please sign in to comment.