From 5ab3bd277affbe57d2b7ffaae65c9b3eb50c9d92 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 10:45:21 +0200 Subject: [PATCH] Small improvements to the error output in component parser to make debugging easier. (backport #1580) (#1582) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 fbb893bdaa645216c1e11d0d6e2cf3dd60f5939d) # Conflicts: # hardware_interface/src/component_parser.cpp * Fix merge conflict --------- Co-authored-by: Dr. Denis Co-authored-by: Christoph Froehlich Co-authored-by: Christoph Fröhlich --- hardware_interface/src/component_parser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hardware_interface/src/component_parser.cpp b/hardware_interface/src/component_parser.cpp index 4f67d3e8b6..b5e4326b98 100644 --- a/hardware_interface/src/component_parser.cpp +++ b/hardware_interface/src/component_parser.cpp @@ -583,11 +583,13 @@ std::vector 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