Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

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

Merged
james-garner-canonical merged 2 commits into
canonical: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 into
canonical:mainfrom
dwilding:error-docs

Conversation

@dwilding

Copy link
Copy Markdown
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

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

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants