Skip to content

Update from_reflect to return a Result with FromReflectError#17295

Draft
elbertronnie wants to merge 2 commits intobevyengine:mainfrom
elbertronnie:return-result-from-reflect
Draft

Update from_reflect to return a Result with FromReflectError#17295
elbertronnie wants to merge 2 commits intobevyengine:mainfrom
elbertronnie:return-result-from-reflect

Conversation

@elbertronnie
Copy link
Contributor

Objective

Solution

  • Create a new Error type FromReflectError that enumerates all possible failure cases.
  • It can pinpoint the exact path of error within a large structure.

Testing

TODO


Showcase

TODO

TODO
println!("My super cool code.");

Migration Guide

  • Append all from_reflect calls with .ok() to convert a Result to an Option.

@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Reflection Runtime information about types labels Jan 10, 2025
@alice-i-cecile alice-i-cecile added X-Uncontroversial This work is generally agreed upon S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Jan 10, 2025
@cart cart added this to Reflection Feb 12, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Reflection Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Reflection Runtime information about types C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Uncontroversial This work is generally agreed upon

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

Enable error returning from FromReflect trait

2 participants