[XML] Improve error message generated by XML_NoChild
This commit is contained in:
parent
6003af01a3
commit
26b937651b
1 changed files with 6 additions and 7 deletions
|
|
@ -100,13 +100,12 @@ public:
|
|||
XML_NoChild(const XML_Node* p, const std::string& parent,
|
||||
std::string child, int line=0) :
|
||||
XML_Error(line) {
|
||||
m_msg += " The XML Node \"" + parent +
|
||||
"\", does not contain a required\n" +
|
||||
" XML child node named \""
|
||||
+ child + "\".\n";
|
||||
ostringstream ss(ostringstream::out);
|
||||
p->write(ss,1);
|
||||
m_msg += ss.str() + "\n";
|
||||
m_msg += fmt::format("The XML Node <{}> does not contain a required "
|
||||
"child node named <{}>.\nExisting children are named:\n",
|
||||
parent, child);
|
||||
for (auto cnode : p->children()) {
|
||||
m_msg += fmt::format(" <{}>\n", cnode->name());
|
||||
}
|
||||
}
|
||||
|
||||
virtual std::string getClass() const {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue