message to cerr as well

This commit is contained in:
Ian Bell
2025-04-12 08:02:44 -04:00
parent b234116404
commit 49a0e1508b

View File

@@ -327,7 +327,9 @@ class Configuration
}
catch(...){
auto skey = config_key_to_string(key);
throw ValueError("Unable to convert \""+std::string(envval)+"\" to int for key ["+skey+"]");
std::string msg = "Unable to convert \""+std::string(envval)+"\" to int for key ["+skey+"]";
std::cerr << msg << std::endl;
throw ValueError(msg);
}
items.erase(key); items.emplace(key, ConfigurationItem(key, i));
break;
@@ -338,7 +340,9 @@ class Configuration
}
catch(...){
auto skey = config_key_to_string(key);
throw ValueError("Unable to convert \""+std::string(envval)+"\" to double for key ["+skey+"]");
std::string msg = "Unable to convert \""+std::string(envval)+"\" to double for key ["+skey+"]";
std::cerr << msg << std::endl;
throw ValueError(msg);
}
items.erase(key); items.emplace(key, ConfigurationItem(key, d));
break;
@@ -349,7 +353,9 @@ class Configuration
}
catch(...){
auto skey = config_key_to_string(key);
throw ValueError("Unable to convert \""+std::string(envval)+"\" to bool for key ["+skey+"]");
std::string msg = "Unable to convert \""+std::string(envval)+"\" to bool for key ["+skey+"]";
std::cerr << msg << std::endl;
throw ValueError(msg);
}
items.erase(key); items.emplace(key, ConfigurationItem(key, b));
break;