craft-platforms errors aren't caught
Metadata
Current evaluation
Craft-platforms errors now display as normal Craft errors instead of internal errors, fixed by merged PR #695 (commit deca76bd).
Resolution: closed resolved
Reason: The issue was fixed by merged PR #695, commit deca76bd, which broadens exception handling for Craft platform errors.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### testcraft.yaml
```yaml
name: testcraft
version: "0.1"
base: ubuntu@24.04
platforms:
a:
build-on: [amd64]
build-for: [all]
b:
build-on: [riscv64]
build-for: [all]
parts:
my-test:
plugin: nil
```
### error
```bash
craft-application/testcraft> python3 __main__.py pack
testcraft internal error: AllSinglePlatformError(message='build-for: all requires exactly one platform definition (2 provided)', details='build-for: all defined in platforms: a,b', resolution="Provide only one platform with only build-for: all or remove 'all' from build-for options.", docs_url=None, doc_slug=None, logpath_report=True, reportable=True, retcode=1)
```
[full pastebin](https://paste.ubuntu.com/p/WHxprfk3Mb/)
### solution
I think that craft-application could either catch and re-raise craft-cli errors or add another `except` block for craft-platforms errors [here](https://github.com/canonical/craft-application/blob/5cf3d4071569e281cf06f07a119e45659d00d3fb/craft_application/application.py#L613).
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Craft-platforms errors now display as normal Craft errors instead of internal errors, fixed by merged PR #695 (commit deca76bd). | |
| stealth/space-bunny-alpha | — | closed resolved | Craft-platforms errors are now reported as normal Craft errors instead of internal errors by merged PR #695 (commit deca76bd). | |
| stealth/space-bunny-alpha | — | closed resolved | Craft-platform errors are now reported as normal Craft errors instead of internal errors via merged PR #695 (commit deca76bd). | |
| stealth/space-bunny-alpha | — | closed resolved | Craft-platforms errors are now reported as normal Craft errors instead of internal errors, fixed by merged PR #695 (commit deca76bd). | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without a code fix; tracking moved to Jira CRAFT-4371. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without a fix. Reported missing exception handling for craft-platforms errors in craft-application. Transferred to Jira ticket CRAFT-4371 for tracking. No code changes or pull requests were merged. | |
| qwen/qwen3.6-35b-a3b | — | — | Reported that craft-platforms validation errors aren't caught by craft-application, causing unhandled internal errors. Suggested adding exception handling. Closed without a public fix or resolution details. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned without a fix; deferred to internal Jira ticket CRAFT-4371. No pull requests were merged to address the uncaught craft-platforms errors. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-application#695
(confidence 100%)
Merged PR #695 contains the resolving change in commit deca76bd.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #479 Application: treat CraftError-like exceptions as CraftErrors | craft-application | open | CraftError-like exceptions bubbling to Application were reported as internal errors; PR #695 added a craft_platforms.CraftError branch in handle_runtime_error, so this appears resolved but the issue remains open. |