Skip to content

Commit 9978749

Browse files
authored
Merge branch 'rolling' into feat/rust-pkg-create
2 parents 7d87bcd + 58f3245 commit 9978749

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ros2doctor/ros2doctor/api/package.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,15 @@ def get_local_package_versions() -> dict:
8383
if package_name_prefixes:
8484
for name, prefix in package_name_prefixes.items():
8585
file_path = os.path.join(prefix, 'share', name)
86-
package_obj = parse_package(file_path)
87-
local_packages[name] = package_obj.version if package_obj.version else ''
86+
try:
87+
package_obj = parse_package(file_path)
88+
local_packages[name] = package_obj.version if package_obj.version else ''
89+
except IOError as e:
90+
print(f'Warning: Could not read package at {file_path}: {e}')
91+
local_packages[name] = ''
92+
except Exception as e:
93+
print(f'Error parsing {file_path}: {e}')
94+
local_packages[name] = ''
8895
return local_packages
8996

9097

0 commit comments

Comments
 (0)