Skip to content

Commit

Permalink
CDirectory should not use sLog for errors
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Maiquez <[email protected]>
  • Loading branch information
Almamu committed Dec 12, 2023
1 parent b58cd97 commit 89a2178
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/WallpaperEngine/Application/CWallpaperApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "WallpaperEngine/Logging/CLog.h"
#include "WallpaperEngine/Render/CRenderContext.h"
#include "WallpaperEngine/Application/CApplicationState.h"
#include "WallpaperEngine/Assets/CAssetLoadException.h"
#include "WallpaperEngine/Audio/Drivers/Detectors/CPulseAudioPlayingDetector.h"
#include "WallpaperEngine/Input/Drivers/CGLFWMouseInput.h"

Expand Down Expand Up @@ -54,7 +55,7 @@ namespace WallpaperEngine::Application
{
container.add (new CDirectory ("../share/"));
}
catch (std::runtime_error& ex)
catch (CAssetLoadException& ex)
{
relative = false;
}
Expand All @@ -63,7 +64,7 @@ namespace WallpaperEngine::Application
{
container.add (new CDirectory (DATADIR));
}
catch (std::runtime_error& ex)
catch (CAssetLoadException& ex)
{
absolute = false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/WallpaperEngine/Assets/CDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ CDirectory::CDirectory (std::filesystem::path basepath) :
struct stat buffer {};

if (stat (this->m_basepath.c_str (), &buffer) != 0)
sLog.exception ("Cannot find ", this->m_basepath, ". This folder is required for wallpaper engine to work");
throw CAssetLoadException (this->m_basepath, "Cannot find directory");

if (!S_ISDIR(buffer.st_mode))
sLog.exception ("Cannot find ", this->m_basepath, ". There's an assets file in it's place");
throw CAssetLoadException (this->m_basepath, "Expected directory but found a file");
}

CDirectory::~CDirectory ()
Expand Down

0 comments on commit 89a2178

Please sign in to comment.