Commit cf2c6e1e authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

log: throw appropriate exceptions if parsing of logging configuration fails

parent 009892f6
......@@ -99,7 +99,7 @@ void Log::parse(json_t *cfg)
"pattern", &pattern
);
if (ret)
throw JsonError(err);
throw ConfigError(cfg, err, "node-config-logging");
if (level)
setLevel(level);
......@@ -118,7 +118,7 @@ void Log::parse(json_t *cfg)
if (json_expressions) {
if (!json_is_array(json_expressions))
throw ConfigError(json_expressions, "node-config.html#node-config-logging-expressions", "The 'expressions' setting must be a list of objects.");
throw ConfigError(json_expressions, "node-config-logging-expressions", "The 'expressions' setting must be a list of objects.");
size_t i;
json_t *json_expression;
......@@ -131,7 +131,7 @@ void Log::parse(json_t *cfg)
"level", &lvl
);
if (ret)
throw JsonError(err);
throw ConfigError(json_expression, err, "node-config-logging-expressions");
Logger logger = get(name);
auto level = spdlog::level::from_str(lvl);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment