Skip to content

Include SystemParamValidationError in RunSystemError and RegisteredSystemError#18666

Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom
chescock:validation-errors-from-run-system
Apr 1, 2025
Merged

Include SystemParamValidationError in RunSystemError and RegisteredSystemError#18666
alice-i-cecile merged 1 commit intobevyengine:mainfrom
chescock:validation-errors-from-run-system

Conversation

@chescock
Copy link
Contributor

@chescock chescock commented Apr 1, 2025

Objective

Provide more useful errors when World::run_system and related methods fail parameter validation.

Let callers determine whether the validation failure would have skipped or failed the system.

Follow-up to #18541.

Solution

Add a SystemParamValidationError value to the RunSystemError::InvalidParams and RegisteredSystemError::InvalidParams variants. That includes the complete context of the parameter validation error, including the skipped flag.

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Apr 1, 2025
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Apr 1, 2025
@alice-i-cecile alice-i-cecile added D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 1, 2025
@alice-i-cecile
Copy link
Member

@ElliottjPierce want to review this one too? :)

Copy link
Contributor

@ElliottjPierce ElliottjPierce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I love seeing those if expressing converted to maps.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 1, 2025
@alice-i-cecile
Copy link
Member

Love to see my TODOs getting cleaned up :) Thanks!

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 1, 2025
Merged via the queue into bevyengine:main with commit 9daf4e7 Apr 1, 2025
43 checks passed
mockersf pushed a commit that referenced this pull request Apr 3, 2025
…stemError (#18666)

# Objective

Provide more useful errors when `World::run_system` and related methods
fail parameter validation.

Let callers determine whether the validation failure would have skipped
or failed the system.

Follow-up to #18541.

## Solution

Add a `SystemParamValidationError` value to the
`RunSystemError::InvalidParams` and
`RegisteredSystemError::InvalidParams` variants. That includes the
complete context of the parameter validation error, including the
`skipped` flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants