From cdfa4ff7a12abd0d39e8b3d0f9d80be946d99bd7 Mon Sep 17 00:00:00 2001 From: Almamu Date: Thu, 16 May 2024 15:22:26 +0200 Subject: [PATCH] chore: some more verbosity on error messages when loading assets --- src/WallpaperEngine/Application/CWallpaperApplication.cpp | 7 ++++++- src/WallpaperEngine/Assets/CCombinedContainer.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/WallpaperEngine/Application/CWallpaperApplication.cpp b/src/WallpaperEngine/Application/CWallpaperApplication.cpp index fba757d..a70d2fb 100644 --- a/src/WallpaperEngine/Application/CWallpaperApplication.cpp +++ b/src/WallpaperEngine/Application/CWallpaperApplication.cpp @@ -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 diff --git a/src/WallpaperEngine/Assets/CCombinedContainer.cpp b/src/WallpaperEngine/Assets/CCombinedContainer.cpp index bfa7607..533a71a 100644 --- a/src/WallpaperEngine/Assets/CCombinedContainer.cpp +++ b/src/WallpaperEngine/Assets/CCombinedContainer.cpp @@ -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 ()); } }