Revisited all error usage to adapt to new craft-cli context.
Metadata
Current evaluation
Merged after approval and CI. Updated error handling for craft-cli by using from err for subprocess errors, adding details attributes, adjusting Store return codes, and transforming StoreServerError. Changed 8 files.
Suggested action: —
No scores available.
Issue body
In detail:
- ensured that when the error comes from a sub-process, use `from err` (no need for another error type, it's just handled by `craft-cli`)
- started to use `details` attribute in some errors, to provide extra info
- returned 1 from commands that actually end ok (raising CommandError) but show error messages that come from an unsuccesful call to the Store
- support `craft-store` raising StoreServerError and transform that correctly
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged after approval and CI. Updated error handling for craft-cli by using from err for subprocess errors, adding details attributes, adjusting Store return codes, and transforming StoreServerError. Changed 8 files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged changes adapting error handling to the new craft-cli context. Subprocess errors now use from err, extra info uses the details attribute, Store failure return codes are corrected, and StoreServerError is properly transformed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged update aligning error handling with craft-cli. Subprocess errors now chain with from err, added details attributes, transformed craft-store StoreServerError, and adjusted return codes for Store failures. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #12 errors: expose the StoreServerError cause from the returned json (CRAFT-582) | craft-store | merged | Exposed the StoreServerError cause from returned JSON. Merged after approval and passing CI checks. Modified three files (+135/-9 lines) to resolve CRAFT-582. | |
| #295 feat: don't use error list as details | craft-store | merged | Merged a fix preventing duplicate error messages in CraftStoreErrors. A craft-cli update started displaying error details by default, causing redundant output. The change modifies logging to use the error list instead, resolving the duplication across two files. | |
| #363 feat: many improvements to error handling/reporting | craft-application | merged | Merged after resolving a craft-cli dependency. Adds error handling improvements: standard exceptions, normalized validation messages, BuildPlanner updates, and doc URLs. Approved by two reviewers and passed CI. | |
| #3744 cli: enable craft-store logging | snapcraft | merged | Enabled craft-store logging in the CLI. Merged after reviewer approval and passing CI. The change modifies a single line in one file, maintaining full code coverage. | |
| #574 requirements: update craft-store and others | charmcraft | merged | Merged dependency updates for craft-store and other packages. Approved by one reviewer with zero unresolved comments. Modified four files, adding and removing 23 lines each. | |
| #3531 cli: warn and error messages to stderr (CRAFT-134) | snapcraft | merged | Merged after approval and passing CI checks. Redirects CLI warning and error messages to stderr, resolving CRAFT-134. Updates 7 files with 19 lines added and removed. | |
| #635 Use all functionality from craft-cli (CRAFT-710). | charmcraft | merged | Merged after approval. Integrated all craft-cli functionality, netting a reduction of 1724 lines across 11 files. Resolves CRAFT-710. | |
| #670 errors: catch all CraftStoreErrors (CRAFT-813) | charmcraft | merged | Merged. Catches all CraftStoreErrors during craft_store library initialization. Approved by one reviewer with passing CI checks across 5 files (+35/-30). |