From 0165d7bc22626aff2f53bad98c895178cf821dc2 Mon Sep 17 00:00:00 2001 From: b-adkins Date: Fri, 1 Nov 2024 00:41:28 -0700 Subject: [PATCH] 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 (, line 7) but not in the providedPorts() of its registered node type. --- src/xml_parsing.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xml_parsing.cpp b/src/xml_parsing.cpp index 2e950e4d9..32a1e42ab 100644 --- a/src/xml_parsing.cpp +++ b/src/xml_parsing.cpp @@ -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 {