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

exceptions: show location of configuration error

parent 88ebc1d6
......@@ -107,7 +107,9 @@ public:
std::runtime_error(what),
id(i),
setting(s)
{ }
{
error.position = -1;
}
template<typename... Args>
ConfigError(json_t *s, const std::string &i, const std::string &what, Args&&... args) :
......@@ -146,6 +148,10 @@ public:
ss << std::runtime_error::what() << std::endl;
ss << " Please consult the user documentation for details: " << docUri();
if (error.position >= 0) {
ss << std::endl << " " << error.text << " in " << error.source << ":" << error.line << ":" << error.column;
}
auto str = new std::string(ss.str());
return str->c_str();
......
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