Enable error returning from FromReflect
trait
#5967
Labels
A-Reflection
Runtime information about types
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
D-Trivial
Nice and easy! A great choice to get started with Bevy
What problem does this solve or what need does it fill?
When dealing with
FromReflect
implementation other thanderive
, it's hard to know where the error is, since if you have a big tree of nesteddyn Reflect
objects, any of them may fail and returnNone
.What solution would you like?
One of those:
try_from_reflect
which does the actual parsing and changefrom_reflect
to a default impl which just calltry_from_reflect
and convertResult
intoOption
;from_reflect
to return aResult
instead ofOption
;I prefer 1, since it doesn't introduce a braking change for those which already uses
from_reflect
, but will break for any manualFromReflect
impl, which I think will be fewer use cases.What alternative(s) have you considered?
Relying on
panic
orerror
messages for any manualFromReflect
implAdditional context
If there is a consensus about this feature, I can impl it
The text was updated successfully, but these errors were encountered: