mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
config: throw exception on non-existing environment variables
This commit is contained in:
parent
b83bec6f7d
commit
303322d4ca
1 changed files with 2 additions and 0 deletions
|
@ -244,6 +244,8 @@ json_t * Config::expandEnvVars(json_t *in)
|
|||
auto const from = match[0];
|
||||
auto const var_name = match[1].str().c_str();
|
||||
char *var_value = std::getenv(var_name);
|
||||
if (!var_value)
|
||||
throw ConfigError(str, "node-config-envvars", "Unresolved environment variable: {}", var_name);
|
||||
|
||||
text.replace(from.first - text.begin(), from.second - from.first, var_value);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue