Skip to content

Commit

Permalink
chore: add config handler error message if config.ini r/w fails
Browse files Browse the repository at this point in the history
  • Loading branch information
vtx22 committed Mar 7, 2025
1 parent 81f1265 commit dce598b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ConfigHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ void ConfigHandler::read_config()
mINI::INIFile _ini_file(SPARQ_CONFIG_FILE);
if (!_ini_file.read(ini))
{
std::cerr << "Failed to read config.ini!" << std::endl;
ImGui::InsertNotification({ImGuiToastType::Error, 3000, "Failed to read config.ini!"});
}
}
Expand All @@ -25,6 +26,7 @@ void ConfigHandler::write_config()
mINI::INIFile _ini_file(SPARQ_CONFIG_FILE);
if (!_ini_file.write(ini))
{
std::cerr << "Failed to write config.ini!" << std::endl;
ImGui::InsertNotification({ImGuiToastType::Error, 3000, "Failed to write config.ini!"});
}
}
1 change: 1 addition & 0 deletions src/ConfigHandler.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <string>
#include <iostream>

#include "sparq_config.h"

Expand Down

0 comments on commit dce598b

Please sign in to comment.