storeapi: add StoreErrorList to handle store errors
Metadata
Current evaluation
Added StoreErrorList class to centralize store error handling. Updated StorePushError to correctly parse resource-not-found and resource-forbidden responses, displaying clear user messages. Merged after reviewer approval, changing six files (+106/-42).
Suggested action: —
No scores available.
Issue body
This class should make it easy to query the error listing
and use the provided messages. It is meant to be used by
composing in the corresponding error classes. This commit
adds it to StorePushError.
StorePushError now properly handles resource-not-found and
resource-forbidden.
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Added StoreErrorList class to centralize store error handling. Updated StorePushError to correctly parse resource-not-found and resource-forbidden responses, displaying clear user messages. Merged after reviewer approval, changing six files (+106/-42). | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Added StoreErrorList class to standardize store API error handling, specifically improving resource-not-found and resource-forbidden messages in StorePushError. Review approved after verifying output format. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Adds StoreErrorList to handle store API errors, improving StorePushError to manage resource-not-found and resource-forbidden cases with clear user messages. Approved after reviewer verification of error output. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3124 storeapi: update api and error messages from push to upload | snapcraft | merged | Merged updates to the storeapi module replacing push terminology with upload in API calls and error messages. Approved by one reviewer, modifying 10 files with 126 additions and 146 deletions. | |
| #3550 storeapi: log responses and registration error code | snapcraft | merged | Merged. Adds debug logging for store API responses and improves registration error code output. The minimal change (+16/-5 lines, 4 files) passed CI, achieved 100% coverage, and was approved for backporting. | |
| #2116 storeapi: handle 5xx error codes for all store endpoints | snapcraft | merged | Merged robust 5xx error handling across all store API endpoints. Fixes Launchpad bug #1768370 by generalizing release-specific error handling. Approved by two reviewers and passed CI checks. | |
| #585 Improve the store errors returning exceptions | snapcraft | merged | Merged changes improving store error handling by returning exceptions. Approved by maintainer come-maiz following multiple retest requests. Modifies 5 files with 93 additions and 61 deletions. |