Skip to content

Commit

Permalink
Fix error message when a package isn't available (#1024)
Browse files Browse the repository at this point in the history
The original behavior was to raise a KeyError with the missing package
name, but this was regressed to an assert with no actionable error
message by a previous change.

Fixes 09a78f4
  • Loading branch information
cottsay authored and nuclearsandwich committed Mar 16, 2024
1 parent d88abf0 commit a199835
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ros_buildfarm/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ def get_binary_package_versions(apt_cache, debian_pkg_names):
pkg = apt_cache.get(debian_pkg_name)
if not pkg:
prov = apt_cache.get_providing_packages(debian_pkg_name)
if not prov:
raise KeyError("No packages available for '%s'" % (debian_pkg_name,))
assert len(prov) == 1
pkg = apt_cache[prov[0]]
versions[debian_pkg_name] = max(pkg.versions).version
Expand Down

0 comments on commit a199835

Please sign in to comment.