fix: catch credential decoding errors
Metadata
Current evaluation
Merged fix catching UnicodeDecodeError during credentials file parsing, replacing the crash with a user-friendly error. Approved by two reviewers, passed all CI checks, and resolves issue #5161.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the guidelines for contributing?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `make lint && make test`?
-----
Invalid text in a credentials file could cause a `UnicodeDecodeError`, which wouldn't get caught by craft-store.
```
snapcraft internal error: UnicodeDecodeError('utf-8', b'\x9d\xfa(', 0, 1, 'invalid start byte')
```
Now, this is caught and raised as a user-friendly error.
Related: https://github.com/canonical/snapcraft/pull/5536
Fixes https://github.com/canonical/snapcraft/issues/5161
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix catching UnicodeDecodeError during credentials file parsing, replacing the crash with a user-friendly error. Approved by two reviewers, passed all CI checks, and resolves issue #5161. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix that catches UnicodeDecodeError when parsing invalid credentials files, replacing the raw exception with a user-friendly error message. Resolves snapcraft issue #5161. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #45 auth: raise error when credentials cannot be parsed (CRAFT-812) | craft-store | merged | Merged changes to craft-store that replace cryptic base64 decoding errors with a clear CredentialsNotParseable exception for invalid credentials. Approved by one reviewer and passed CI. |