mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
exceptions: show location of configuration error
This commit is contained in:
parent
c855ac37c3
commit
8c7bde39c8
1 changed files with 7 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue