Skip to content

Commit 0165d7b

Browse files
authored
Improved XML parsing error message to say where in the XML the offending port is found. (#876)
Example output: a port with name [ball_pose] is found in the XML (<GrabBall>, line 7) but not in the providedPorts() of its registered node type.
1 parent 1fcb624 commit 0165d7b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/xml_parsing.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,10 @@ TreeNode::Ptr XMLParser::PImpl::createNodeFromXML(const XMLElement* element,
667667
if(port_model_it == manifest->ports.end())
668668
{
669669
throw RuntimeError(StrCat("a port with name [", port_name,
670-
"] is found in the XML, but not in the "
671-
"providedPorts()"));
670+
"] is found in the XML (<", element->Name(),
671+
">, line ", std::to_string(att->GetLineNum()),
672+
") but not in the providedPorts() of its "
673+
"registered node type."));
672674
}
673675
else
674676
{

0 commit comments

Comments
 (0)