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) (#1582)

* 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]>
Co-authored-by: Christoph Fröhlich <[email protected]>
  • Loading branch information
4 people authored Jul 13, 2024
1 parent 3abe840 commit 5ab3bd2
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 @@ -583,11 +583,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 5ab3bd2

Please sign in to comment.