Skip to content

docs: for apt, clarify that add_package doesn't raise PackageNotFoundError#167

Merged
james-garner-canonical merged 2 commits intocanonical:mainfrom
dwilding:error-docs
Aug 21, 2025
Merged

docs: for apt, clarify that add_package doesn't raise PackageNotFoundError#167
james-garner-canonical merged 2 commits intocanonical:mainfrom
dwilding:error-docs

Conversation

@dwilding
Copy link
Contributor

When testing the apt library, I noticed that add_package doesn't raise PackageNotFoundError if any packages aren't found. Instead, the function raises PackageError. That's because add_package relies on a function _add to add each package, and _add catches PackageNotFoundError and returns a boolean instead.

This PR updates the relevant docs to clarify when PackageNotFoundError is raised. Matches canonical/charmlibs#124

@dwilding dwilding marked this pull request as ready for review August 21, 2025 12:07
Copy link
Contributor

@james-garner-canonical james-garner-canonical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this

@james-garner-canonical james-garner-canonical merged commit bff6bba into canonical:main Aug 21, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants