← Back to issue list

lxd: proper error classes for container errors

View original Github issue

Metadata

Project
snapcraft
Number
#2095
Type
pull request
State
merged
Author
kalikiana
Labels
—
Created
Updated
Closed

Current evaluation

Merged as caf555acb, introducing dedicated LXD error classes, improving architecture lookup error handling, and adding unit tests.

Resolution: closed resolved

Reason: PR #2095 was merged in commit caf555acb. It moved container errors into the LXD module, improved architecture error handling, and fixed LP bugs #1734233 and #1734235.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh unit`? ----- This PR refactors container errors to have proper classes and moves them into the LXD module. Also errors are moved into a separate unit test. This includes a fix for error handling of and tests for getting the architecture from the container. This is part of #1705. Fixes: [LP: #1734233](https://bugs.launchpad.net/snapcraft/+bug/1734233) [LP: #1734235](https://bugs.launchpad.net/snapcraft/+bug/1734235) The following new tests are affected: - tests.unit.test_lxd_errors - To verify the new and updated error classes. - tests.unit.lxd.test_architecture_* - To verify failing to get the architecture from the LXD container. I locally ran the tests: - `./runtests.sh tests/unit` with unrelated failures in [tests.unit.test_lifecycle.CoreSetupTestCase.test_core_setup_if_docker_env](https://bugs.launchpad.net/snapcraft/+bug/1752576), `tests.unit.test_mangling.TestClearExecstack.test_execstack_clears` and `tests.unit.test_elf`. - `./runtests.sh tests/integration` with one unrelated failure in [tests.integration.general.test_parser.TestParserWikis](https://bugs.launchpad.net/snapcraft/+bug/1752580) - `./runtests.sh static`: Everything passed

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged as caf555acb, introducing dedicated LXD error classes, improving architecture lookup error handling, and adding unit tests.
stealth/space-bunny-alpha — closed resolved Merged as commit caf555acb (PR #2095): refactored LXD container errors into proper exception classes in the lxd module, improved architecture error handling, and added tests.unit.test_lxd_errors plus lxd test_architecture_* tests. Part of #1705; fixes LP #1734233/#1734235.
stealth/space-bunny-alpha — closed resolved Merged as caf555acb (PR #2095), moving LXD errors into dedicated classes, improving container architecture error handling, and adding unit tests.
qwen/qwen3.6-35b-a3b — — Merged after approval. Refactored LXD container errors into dedicated classes, relocated them to the LXD module, and fixed architecture retrieval error handling. Added corresponding unit tests. Resolves Launchpad bugs #1734233 and #1734235.
qwen3.6-35b-a3b-mtp-q6 — — Merged changes refactoring LXD container errors into dedicated classes within the LXD module. Relocated error handling and unit tests, fixed architecture retrieval error handling, and resolved Launchpad bugs #1734233 and #1734235.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#1705 (confidence 100%)

    PR #2095 explicitly identifies itself as part of the broader #1705 error-handling effort.

Related issues

Issue Project State Summary Similarity
#161 lxd: improve error messages craft-providers merged Merged PR #161 consolidated duplicate LXD error messages and added help text to other errors in commit 18d4470.
75%
#1647 lxd: better surfacing of errors snapcraft merged Merged in snapcraft#1647 as commit 71f48bdc9, improving LXD error handling so callers return silent, correctly coded errors without printing messages twice.
74%
#29 lxd: introduce errors module and LXDError craft-providers merged PR #29 merged into main (merge commit ceafb67, commit 509204c 'lxd: introduce errors module and LXDError'), adding craft_providers/lxd/errors.py with LXDError plus LXDInstallationError and LXDUnstableImageError.
73%
#1627 lxd: split container classes into different files snapcraft merged Merged in snapcraft#1627 via d2118855c, splitting LXD container classes into separate modules, relocating Cleanbuilder methods and deduplicating environment setup without functional changes.
71%