@@ -8,8 +8,8 @@ use bevy_ecs::{
8
8
world:: { Command , Mut , World } ,
9
9
} ;
10
10
use bevy_hierarchy:: { AddChild , BuildChildren , DespawnRecursiveExt , Parent } ;
11
- use bevy_utils:: { tracing :: error , HashMap , HashSet } ;
12
- use thiserror :: Error ;
11
+ use bevy_utils:: { HashMap , HashSet } ;
12
+ use derive_more :: derive :: { Display , Error } ;
13
13
use uuid:: Uuid ;
14
14
15
15
/// Triggered on a scene's parent entity when [`crate::SceneInstance`] becomes ready to use.
@@ -72,22 +72,22 @@ pub struct SceneSpawner {
72
72
}
73
73
74
74
/// Errors that can occur when spawning a scene.
75
- #[ derive( Error , Debug ) ]
75
+ #[ derive( Error , Display , Debug ) ]
76
76
pub enum SceneSpawnError {
77
77
/// Scene contains an unregistered component type.
78
- #[ error ( "scene contains the unregistered component `{type_path}`. consider adding `#[reflect(Component)]` to your type" ) ]
78
+ #[ display ( "scene contains the unregistered component `{type_path}`. consider adding `#[reflect(Component)]` to your type" ) ]
79
79
UnregisteredComponent {
80
80
/// Type of the unregistered component.
81
81
type_path : String ,
82
82
} ,
83
83
/// Scene contains an unregistered resource type.
84
- #[ error ( "scene contains the unregistered resource `{type_path}`. consider adding `#[reflect(Resource)]` to your type" ) ]
84
+ #[ display ( "scene contains the unregistered resource `{type_path}`. consider adding `#[reflect(Resource)]` to your type" ) ]
85
85
UnregisteredResource {
86
86
/// Type of the unregistered resource.
87
87
type_path : String ,
88
88
} ,
89
89
/// Scene contains an unregistered type.
90
- #[ error (
90
+ #[ display (
91
91
"scene contains the unregistered type `{std_type_name}`. \
92
92
consider reflecting it with `#[derive(Reflect)]` \
93
93
and registering the type using `app.register_type::<T>()`"
@@ -97,7 +97,7 @@ pub enum SceneSpawnError {
97
97
std_type_name : String ,
98
98
} ,
99
99
/// Scene contains an unregistered type which has a `TypePath`.
100
- #[ error (
100
+ #[ display (
101
101
"scene contains the reflected type `{type_path}` but it was not found in the type registry. \
102
102
consider registering the type using `app.register_type::<T>()``"
103
103
) ]
@@ -106,19 +106,19 @@ pub enum SceneSpawnError {
106
106
type_path : String ,
107
107
} ,
108
108
/// Scene contains a proxy without a represented type.
109
- #[ error ( "scene contains dynamic type `{type_path}` without a represented type. consider changing this using `set_represented_type`." ) ]
109
+ #[ display ( "scene contains dynamic type `{type_path}` without a represented type. consider changing this using `set_represented_type`." ) ]
110
110
NoRepresentedType {
111
111
/// The dynamic instance type.
112
112
type_path : String ,
113
113
} ,
114
114
/// Dynamic scene with the given id does not exist.
115
- #[ error ( "scene does not exist" ) ]
115
+ #[ display ( "scene does not exist" ) ]
116
116
NonExistentScene {
117
117
/// Id of the non-existent dynamic scene.
118
118
id : AssetId < DynamicScene > ,
119
119
} ,
120
120
/// Scene with the given id does not exist.
121
- #[ error ( "scene does not exist" ) ]
121
+ #[ display ( "scene does not exist" ) ]
122
122
NonExistentRealScene {
123
123
/// Id of the non-existent scene.
124
124
id : AssetId < Scene > ,
0 commit comments