Skip to content

Commit

Permalink
include examples for command error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSWard committed May 26, 2021
1 parent 141b5fa commit ecfe507
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ path = "examples/ecs/ecs_guide.rs"
name = "change_detection"
path = "examples/ecs/change_detection.rs"

[[example]]
name = "command_error_handling"
path = "examples/ecs/command_error_handling.rs"

[[example]]
name = "event"
path = "examples/ecs/event.rs"
Expand Down
5 changes: 3 additions & 2 deletions crates/bevy_ecs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ pub mod prelude {
Schedule, Stage, StageLabel, State, SystemLabel, SystemSet, SystemStage,
},
system::{
Commands, In, IntoChainSystem, IntoExclusiveSystem, IntoSystem, Local, NonSend,
NonSendMut, Query, QuerySet, RemovedComponents, Res, ResMut, System,
CommandError, Commands, FallibleCommand, In, IntoChainSystem, IntoExclusiveSystem,
IntoSystem, Local, NonSend, NonSendMut, Query, QuerySet, RemovedComponents, Res,
ResMut, System,
},
world::{FromWorld, Mut, World},
};
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/system/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use crate::{
};
use std::{fmt::Debug, marker::PhantomData};

pub use config::{FallibleCommandConfig, FinalFallibleCommandConfig};
pub use fallible::{CommandError, FallibleCommand};
pub use config::*;
pub use fallible::*;

/// A [`World`] mutation.
/// If this could potentially fail, use [`FallibleCommand`].
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Example | File | Description
--- | --- | ---
`ecs_guide` | [`ecs/ecs_guide.rs`](./ecs/ecs_guide.rs) | Full guide to Bevy's ECS
`change_detection` | [`ecs/change_detection.rs`](./ecs/change_detection.rs) | Change detection on components
`command_error_handling` | [`ecs/command_error_handling.rs](./ecs/command_error_handling.rs) | Error handling fallible commands
`event` | [`ecs/event.rs`](./ecs/event.rs) | Illustrates event creation, activation, and reception
`fixed_timestep` | [`ecs/fixed_timestep.rs`](./ecs/fixed_timestep.rs) | Shows how to create systems that run every fixed timestep, rather than every tick
`hierarchy` | [`ecs/hierarchy.rs`](./ecs/hierarchy.rs) | Creates a hierarchy of parents and children entities
Expand Down

0 comments on commit ecfe507

Please sign in to comment.