mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
258f495352
# Objective - Help debug panics ## Solution - Insert a custom panic hook when trace is enabled that will log spans example when running a command on a despawned entity before: ``` thread 'main' panicked at 'Could not add a component (of type `panic::Marker`) to entity 1v0 because it doesn't exist in this World. If this command was added to a newly spawned entity, ensure that you have not despawned that entity within the same stage. This may have occurred due to system order ambiguity, or if the spawning system has multiple command buffers', /bevy/crates/bevy_ecs/src/system/commands/mod.rs:664:13 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` after: ``` 0: bevy_ecs::schedule::stage::system_commands with name="panic::my_bad_system" at crates/bevy_ecs/src/schedule/stage.rs:871 1: bevy_ecs::schedule::stage with name=Update at crates/bevy_ecs/src/schedule/mod.rs:340 2: bevy_app::app::frame at crates/bevy_app/src/app.rs:111 3: bevy_app::app::bevy_app at crates/bevy_app/src/app.rs:126 thread 'main' panicked at 'Could not add a component (of type `panic::Marker`) to entity 1v0 because it doesn't exist in this World. If this command was added to a newly spawned entity, ensure that you have not despawned that entity within the same stage. This may have occurred due to system order ambiguity, or if the spawning system has multiple command buffers', /bevy/crates/bevy_ecs/src/system/commands/mod.rs:664:13 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` |
||
---|---|---|
.. | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_crevice | ||
bevy_derive | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_ecs_compile_fail_tests | ||
bevy_gilrs | ||
bevy_gltf | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_math | ||
bevy_pbr | ||
bevy_reflect | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_tasks | ||
bevy_text | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |