mirror of
https://github.com/bevyengine/bevy
synced 2024-12-21 10:33:08 +00:00
53910e07ae
# Objective The error messages that appear when a value cannot be serialized or deserialized via reflection could be slightly improved. When one of these operations fails, some users are confused about how to resolve the issue. I've spoken with a few who didn't know they could register `ReflectSerialize` themselves. We should try to clarify this to some degree in the error messages. ## Solution Add some more detail to the error messages. For example, replacing this: ``` Type 'core::ops::RangeInclusive<f32>' did not register ReflectSerialize ``` with this: ``` Type `core::ops::RangeInclusive<f32>` did not register the `ReflectSerialize` type data. For certain types, this may need to be registered manually using `register_type_data` ``` I also added a separate error message if the type was not registered in the type registry at all: ``` Type `core::ops::RangeInclusive<f32>` is not registered in the type registry ``` ## Testing You can test locally by running: ``` cargo test --package bevy_reflect ``` --- ## Changelog - Added error message for missing type registration when serializing reflect data - Changed error message for missing `ReflectSerialize` registration when serializing reflect data - Changed error message for missing `ReflectDeserialize` registration when deserializing reflect data |
||
---|---|---|
.. | ||
enums | ||
impls | ||
path | ||
serde | ||
array.rs | ||
attributes.rs | ||
fields.rs | ||
from_reflect.rs | ||
lib.rs | ||
list.rs | ||
map.rs | ||
reflect.rs | ||
std_traits.rs | ||
struct_trait.rs | ||
tuple.rs | ||
tuple_struct.rs | ||
type_info.rs | ||
type_path.rs | ||
type_registry.rs | ||
utility.rs |