aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-03-11 01:39:00 +0000
committerVaxry <[email protected]>2024-03-11 01:39:00 +0000
commit66330281ff19e84c986c5ce639b670929e5dadd6 (patch)
tree7023ca6dd5d815034f3ebc0ff16f7a9ad92c2590
parent220144276b8789d05e58df3e0452314c11b64728 (diff)
downloadHyprland-66330281ff19e84c986c5ce639b670929e5dadd6.tar.gz
Hyprland-66330281ff19e84c986c5ce639b670929e5dadd6.zip
config: report errors from sourced files
-rw-r--r--src/config/ConfigManager.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 0409140a..618a6294 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -2243,6 +2243,8 @@ std::optional<std::string> CConfigManager::handleSource(const std::string& comma
return err;
}
+ std::string errorsFromParsing;
+
for (size_t i = 0; i < glob_buf->gl_pathc; i++) {
auto value = absolutePath(glob_buf->gl_pathv[i], configCurrentPath);
@@ -2268,12 +2270,17 @@ std::optional<std::string> CConfigManager::handleSource(const std::string& comma
auto configCurrentPathBackup = configCurrentPath;
configCurrentPath = value;
- m_pConfig->parseFile(value.c_str());
+ const auto THISRESULT = m_pConfig->parseFile(value.c_str());
configCurrentPath = configCurrentPathBackup;
+
+ if (THISRESULT.error && errorsFromParsing.empty())
+ errorsFromParsing += THISRESULT.getError();
}
- return {};
+ if (errorsFromParsing.empty())
+ return {};
+ return errorsFromParsing;
}
std::optional<std::string> CConfigManager::handleEnv(const std::string& command, const std::string& value) {