providers: improve error handling (CRAFT-472)
Metadata
Current evaluation
Merged PR #504 improved LXD and Multipass provider error handling, chained exceptions, and added tests for CRAFT-472.
Resolution: closed resolved
Reason: PR #504 was merged via commit 4dd441c0, with implementation commit 05c8220f adding comprehensive provider exception handling, exception chaining, and test coverage.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- Ensure there is error handling for all provider-generated
exceptions. Catch BaseConfigurationError when launching
environments for LXD and Multipass and add missing try/except
cases in LXD provider.
- Ensure all exceptions are chained (and make sure the tests
validate it)
- Add test coverage for added exception handling.
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #504 improved LXD and Multipass provider error handling, chained exceptions, and added tests for CRAFT-472. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #504 (05c8220f), adding LXD/Multipass exception handling, exception chaining, and test coverage for CRAFT-472. | |
| qwen/qwen3.6-35b-a3b | — | — | Improved error handling for provider-generated exceptions by adding try/except blocks for LXD and Multipass, chaining exceptions, and adding test coverage. Merged after approval and passing CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged improvements to provider error handling, adding BaseConfigurationError catching for LXD and Multipass, ensuring proper exception chaining, and adding test coverage. Resolves CRAFT-472. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4262 LXD errors from Craft Providers not properly presented | snapcraft | closed | Fixed by #4295 (commit 511061252), which catches Craft Providers errors and shows user-friendly messages instead of tracebacks; backported for 7.5 by #4419 (commit 6b2f6d207). | |
| #484 providers: refactor to better support multiple providers (CRAFT-362) | charmcraft | merged | Merged PR #484 (commit 93982f90, merge 7a1f50fc) by cjp256 converted providers module into a package for CRAFT-362: added common Provider class, LXDProvider subclass and get_provider(); follow-ups moved get_provider() to providers.py and renamed _helpers to _logs. | |
| #419 providers: gracefully handle when LXD not installed (CRAFT-329) | charmcraft | merged | Merged #419 to handle missing LXD: builds now require the provider, while cleanup safely skips container operations when LXD is unavailable. | |
| #899 providers: use new craft-providers interface | charmcraft | merged | Merged PR #899 (merge commit 538aec31, implementation 5e5acb7c): removed Charmcraft's own Provider/LXDProvider/MultipassProvider classes in favour of craft-providers', and moved charmcraft/providers/providers.py to charmcraft/providers.py. Resolves CRAFT-1279. | |
| #163 providers: add Provider, LXDProvider, and MultipassProvider classes | craft-providers | merged | Merged Provider, LXDProvider, and MultipassProvider classes via commit fa5a5e7, adding simplified provider error handling and integration tests. | |
| #3660 providers: integrate craft-providers support | snapcraft | merged | PR #3660 by cmatsuoka integrated craft-providers into Snapcraft, running lifecycle commands in LXD/Multipass instances. Merged into the 7.0 line via merge commit 7c2ac0027 (squash commit 8a06cdbbd). | |
| #9 providers: add build provider support (CRAFT-28) | rockcraft | merged | Merged build-provider support via commit be6dec45, integrating craft-providers to run builds on LXD. User messages and provider log retrieval were deferred to follow-up work. | |
| #341 lxd: race condition when running multiple instances of craft-providers | craft-providers | closed | Fixed by merged PR #357, which rechecks LXC project existence after creation fails, preventing concurrent project-creation races (CRAFT-1849). |