← Back to issue list

fix(errors): render user-config and base-alias failures as structured errors

View original Github issue

Metadata

Project
craft-application
Number
#1082
Type
pull request
State
open
Author
tonyandrewmeyer
Labels
Created
Updated
Closed

Current evaluation

Converts pydantic ValidationError and base-alias lookup failures into structured CraftValidationError with user-friendly messages instead of raw tracebacks. Approved by 2 reviewers but has 11 unresolved review comments and 53 days of inactivity.

Suggested action: needs review

Reason: The PR has 2 approvals and passing CI, but 11 unresolved review comments and 53 days of inactivity indicate it needs author response. The recent comment from @bepri requesting author review confirms maintainer engagement is ongoing. The change is small (+118/-2 lines, 3 files) and improves user experience by replacing raw tracebacks with structured error messages.

Impact: 45 Quick Win: 33.75 Staleness: 65 Complexity: 25 Confidence: 75

Issue body

Unhandled pydantic `ValidationError`s and host base-alias lookup failures fall through to the generic handler and are reported as '<app> internal error: ...' with exit code 70, leaking a raw Python / pydantic traceback (including the errors.pydantic.dev link) for what are plainly user configuration problems. This PR changes `handle_runtime_error` to convert pydantic.ValidationError into a structured `CraftValidationError` with a 'Recommended resolution' (exit `EX_DATAERR`), and surfaces 'not a valid BuilddBaseAlias' `ValueError`s as a structured config error (exit `EX_CONFIG`). `pydantic.ValidationError` is a `ValueError` subclass, so it is matched first. A TODO marks a potential deeper fix for the base-alias lookup site. - [x] Have you followed the guidelines for contributing? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint && make test`? (I only get the same failures as main). - [x] Have you added an entry to the changelog (`docs/reference/changelog.rst`)? ---

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 45
Quick Win: 33.75
Staleness: 65
Complexity: 25
Confidence: 75
needs review Converts pydantic ValidationError and base-alias lookup failures into structured CraftValidationError with user-friendly messages instead of raw tracebacks. Approved by 2 reviewers but has 11 unresolved review comments and 53 days of inactivity.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 15
Confidence: 85
needs review Converts unhandled pydantic validation errors and base-alias lookup failures into structured user-facing errors with recommended resolutions. Currently approved by two reviewers but has 11 unresolved comments and awaits author response to a recent review request.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 25
Confidence: 90
needs review Converts unhandled pydantic validation and base-alias lookup errors into structured user-facing messages with appropriate exit codes, replacing raw Python tracebacks. Currently awaiting maintainer review.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 20
Confidence: 90
needs review Refactors error handling to convert unhandled pydantic validation and base-alias lookup failures into structured, user-friendly errors with appropriate exit codes, replacing raw Python tracebacks. Awaiting maintainer review.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.