summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2023-02-20 20:56:09 +0100
committerJoel Rosdahl <joel@rosdahl.net>2023-03-04 10:10:19 +0100
commitf8565ec6a72972c2fb8e6676d3dba3e85961b356 (patch)
treed74a846d2cbf50b1dc97477e8ce16684cfc1110f
parentd56c03875a5fb3a931854481900e6fe18a3202bd (diff)
downloadccache-f8565ec6a72972c2fb8e6676d3dba3e85961b356.tar.gz
feat: Improve error message when failing to parse command line config
-rw-r--r--src/Config.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Config.cpp b/src/Config.cpp
index 3312ac81..42b254c1 100644
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -664,7 +664,12 @@ void
Config::update_from_map(const std::unordered_map<std::string, std::string>& map)
{
for (const auto& [key, value] : map) {
- set_item(key, value, std::nullopt, false, "command line");
+ try {
+ set_item(key, value, std::nullopt, false, "command line");
+ } catch (core::Error& e) {
+ throw core::Error(
+ FMT("when parsing command line config \"{}\": {}", key, e.what()));
+ }
}
}