Skip to content

Commit

Permalink
Improved XML parsing error message to say where in the XML the offend…
Browse files Browse the repository at this point in the history
…ing 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.
  • Loading branch information
b-adkins authored Nov 1, 2024
1 parent 1fcb624 commit 0165d7b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/xml_parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,10 @@ TreeNode::Ptr XMLParser::PImpl::createNodeFromXML(const XMLElement* element,
if(port_model_it == manifest->ports.end())
{
throw RuntimeError(StrCat("a port with name [", port_name,
"] is found in the XML, but not in the "
"providedPorts()"));
"] is found in the XML (<", element->Name(),
">, line ", std::to_string(att->GetLineNum()),
") but not in the providedPorts() of its "
"registered node type."));
}
else
{
Expand Down

0 comments on commit 0165d7b

Please sign in to comment.