Add error handling when parsing package locally #1108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When running
ros2 doctor --report, I encountered the following warning:Additionally, none of the packages displayed their versions. This issue appears to be caused by missing package.xml files in several rmf-* packages. I have already filed a ticket at open-rmf/rmf_traffic#125.
However, I think we could also improve
ros2 doctorby catching the exception when parsing packages. https://github.com/ros-infrastructure/catkin_pkg/blob/921fc9e64af6b78fe84cd9dbb92a4d660c3dafa4/src/catkin_pkg/package.py#L571-L584Is this user-facing behavior change?
Did you use Generative AI?
No
Additional Information
Before this PR, only a warning for package report:
After this PR, ros2 doctor --report now logs warnings for problematic packages instead of silently failing:
For these packages, the local version field is now left blank in the report: