From 7248ec96bfe48d7395a215f112d89a12c8cd221a Mon Sep 17 00:00:00 2001 From: mini-1235 Date: Sat, 15 Nov 2025 11:10:03 +0000 Subject: [PATCH] Improve logging when unable to parse the plugin Signed-off-by: mini-1235 --- ros2plugin/ros2plugin/verb/list.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ros2plugin/ros2plugin/verb/list.py b/ros2plugin/ros2plugin/verb/list.py index fd7a6c9..a68c28d 100644 --- a/ros2plugin/ros2plugin/verb/list.py +++ b/ros2plugin/ros2plugin/verb/list.py @@ -65,8 +65,13 @@ def main(self, *, args): plugin_xml = os.path.join(package_prefix, package_plugin_resource) if not os.path.isfile(plugin_xml): print('XML manifest ' + os.path.basename(plugin_xml) + ' not found.') - - tree = ET.parse(plugin_xml) + try: + tree = ET.parse(plugin_xml) + except ET.ParseError as e: + print( + f'Failed to parse plugin XML file: {plugin_xml}\n' + f'XML error: {e}' + ) for e in tree.iter(): if e.tag == 'class':