Skip to content

Commit

Permalink
Small improvements to the error output in component parser to make de…
Browse files Browse the repository at this point in the history
…bugging easier. (backport #1580) (#1581)

* Small improvements to the error output in component parser to make debugging easier. (#1580)

* Small improvements to the error output in component parser to make debugging easier.

* Correct formatting.

(cherry picked from commit fbb893b)

# Conflicts:
#	hardware_interface/src/component_parser.cpp

* Fix merge conflict

---------

Co-authored-by: Dr. Denis <[email protected]>
Co-authored-by: Christoph Froehlich <[email protected]>
  • Loading branch information
3 people authored Jul 13, 2024
1 parent 83572e5 commit a03055d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hardware_interface/src/component_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,13 @@ std::vector<HardwareInfo> parse_control_resources_from_urdf(const std::string &
tinyxml2::XMLDocument doc;
if (!doc.Parse(urdf.c_str()) && doc.Error())
{
throw std::runtime_error("invalid URDF passed in to robot parser");
throw std::runtime_error(
"invalid URDF passed in to robot parser: " + std::string(doc.ErrorStr()));
}
if (doc.Error())
{
throw std::runtime_error("invalid URDF passed in to robot parser");
throw std::runtime_error(
"invalid URDF passed in to robot parser: " + std::string(doc.ErrorStr()));
}

// Find robot tag
Expand Down

0 comments on commit a03055d

Please sign in to comment.