Skip to content

Commit ecfe507

Browse files
committed
include examples for command error handling
1 parent 141b5fa commit ecfe507

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ path = "examples/ecs/ecs_guide.rs"
255255
name = "change_detection"
256256
path = "examples/ecs/change_detection.rs"
257257

258+
[[example]]
259+
name = "command_error_handling"
260+
path = "examples/ecs/command_error_handling.rs"
261+
258262
[[example]]
259263
name = "event"
260264
path = "examples/ecs/event.rs"

crates/bevy_ecs/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ pub mod prelude {
2727
Schedule, Stage, StageLabel, State, SystemLabel, SystemSet, SystemStage,
2828
},
2929
system::{
30-
Commands, In, IntoChainSystem, IntoExclusiveSystem, IntoSystem, Local, NonSend,
31-
NonSendMut, Query, QuerySet, RemovedComponents, Res, ResMut, System,
30+
CommandError, Commands, FallibleCommand, In, IntoChainSystem, IntoExclusiveSystem,
31+
IntoSystem, Local, NonSend, NonSendMut, Query, QuerySet, RemovedComponents, Res,
32+
ResMut, System,
3233
},
3334
world::{FromWorld, Mut, World},
3435
};

crates/bevy_ecs/src/system/commands/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use crate::{
99
};
1010
use std::{fmt::Debug, marker::PhantomData};
1111

12-
pub use config::{FallibleCommandConfig, FinalFallibleCommandConfig};
13-
pub use fallible::{CommandError, FallibleCommand};
12+
pub use config::*;
13+
pub use fallible::*;
1414

1515
/// A [`World`] mutation.
1616
/// If this could potentially fail, use [`FallibleCommand`].

examples/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ Example | File | Description
150150
--- | --- | ---
151151
`ecs_guide` | [`ecs/ecs_guide.rs`](./ecs/ecs_guide.rs) | Full guide to Bevy's ECS
152152
`change_detection` | [`ecs/change_detection.rs`](./ecs/change_detection.rs) | Change detection on components
153+
`command_error_handling` | [`ecs/command_error_handling.rs](./ecs/command_error_handling.rs) | Error handling fallible commands
153154
`event` | [`ecs/event.rs`](./ecs/event.rs) | Illustrates event creation, activation, and reception
154155
`fixed_timestep` | [`ecs/fixed_timestep.rs`](./ecs/fixed_timestep.rs) | Shows how to create systems that run every fixed timestep, rather than every tick
155156
`hierarchy` | [`ecs/hierarchy.rs`](./ecs/hierarchy.rs) | Creates a hierarchy of parents and children entities

0 commit comments

Comments
 (0)