← Back to issue list

fix: don't raise CraftValidationErrors in validators

View original Github issue

Metadata

Project
rockcraft
Number
#600
Type
pull request
State
merged
Author
tigarmo
Labels
Created
Updated
Closed

Current evaluation

Merged. Validators now raise standard Pydantic errors instead of CraftValidationErrors, allowing Pydantic to group them into a single ValidationError for uniform reporting. Approved by two reviewers and passed CI.

Suggested action:

No scores available.

Issue body

The rule is this: in validators, always raise the types that Pydantic expects (ValueErrors, AssertionErrors, TypeError, and subclasses of these). This allows Pydantic to capture all errors and group them into a single ValidationError, which we can then convert into a single CraftValidationError in from_yaml_data(). This provides a more uniform UI for the reporting of validation errors on the project. - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged. Validators now raise standard Pydantic errors instead of CraftValidationErrors, allowing Pydantic to group them into a single ValidationError for uniform reporting. Approved by two reviewers and passed CI.
qwen3.6-35b-a3b-mtp-q6 Merged fix updating validators to raise standard Pydantic errors instead of CraftValidationErrors. Pydantic aggregates these into a single ValidationError, later converted to one CraftValidationError in from_yaml_data() for consistent error reporting.
qwen3.6-35b-a3b-mtp-q6 Merged a fix ensuring validators raise standard Pydantic errors instead of CraftValidationErrors. Pydantic now consolidates these into a single ValidationError, converted to one CraftValidationError in from_yaml_data() for consistent error reporting.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#94 errors: reformat pydantic validation error (CRAFT-368) craft-parts merged Merged after reviewer approval and passing CI. Reformatted Pydantic validation errors for improved readability. Centralized formatting in charmcraft while preserving standalone craft-parts error handling.
73%