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 Mar 11, 2024
1 parent 09a78f4 commit 7c12df5
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 7c12df5

Please sign in to comment.