@@ -402,7 +402,7 @@ impl<T> Debug for InsertBundleError<T> {
402
402
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
403
403
f. debug_struct ( "InsertBundleError" )
404
404
. field ( "entity" , & self . entity )
405
- . field ( "bundle " , & std:: any:: type_name :: < T > ( ) )
405
+ . field ( "bundle_type " , & std:: any:: type_name :: < T > ( ) )
406
406
. finish ( )
407
407
}
408
408
}
@@ -441,7 +441,7 @@ impl<T> Debug for InsertError<T> {
441
441
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
442
442
f. debug_struct ( "InsertError" )
443
443
. field ( "entity" , & self . entity )
444
- . field ( "component " , & std:: any:: type_name :: < T > ( ) )
444
+ . field ( "component_type " , & std:: any:: type_name :: < T > ( ) )
445
445
. finish ( )
446
446
}
447
447
}
@@ -748,4 +748,19 @@ mod tests {
748
748
749
749
assert_eq ! ( invoked. load( Ordering :: Relaxed ) , 1 ) ;
750
750
}
751
+
752
+ #[ test]
753
+ #[ should_panic]
754
+ fn test_panicking_error_handler ( ) {
755
+ std:: panic:: set_hook ( Box :: new ( |_| { } ) ) ; // prevents printing of stack trace.
756
+
757
+ let mut world = World :: default ( ) ;
758
+ let mut queue = CommandQueue :: default ( ) ;
759
+ {
760
+ let mut commands = Commands :: new ( & mut queue, & world) ;
761
+ let invalid_entity = Entity :: new ( 42 ) ;
762
+ commands. entity ( invalid_entity) . despawn ( ) . panic_on_failure ( ) ;
763
+ }
764
+ queue. apply ( & mut world) ;
765
+ }
751
766
}
0 commit comments