Skip to content

Commit eb03e3b

Browse files
update links
1 parent 5c93143 commit eb03e3b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

crates/bevy_ecs/src/error/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! [`panic`] error handler function is used, resulting in a panic with the error message attached.
99
//!
1010
//! You can change the default behavior by registering a custom error handler:
11-
//! Use [`World::set_default_error_handler`] to set a custom error handler function for a world,
11+
//! Use [`DefaultErrorHandler`] to set a custom error handler function for a world,
1212
//! or `App::set_error_handler` for a whole app.
1313
//! In practice, this is generally feature-flagged: panicking or loudly logging errors in development,
1414
//! and quietly logging or ignoring them in production to avoid crashing the app.
@@ -35,7 +35,7 @@
3535
//! context surrounding the error – such as the system's [`name`] – in your error messages.
3636
//!
3737
//! ```rust, ignore
38-
//! use bevy_ecs::error::{BevyError, ErrorContext};
38+
//! use bevy_ecs::error::{BevyError, ErrorContext, DefaultErrorHandler};
3939
//! use log::trace;
4040
//!
4141
//! fn my_error_handler(error: BevyError, ctx: ErrorContext) {
@@ -48,8 +48,8 @@
4848
//!
4949
//! fn main() {
5050
//! let mut world = World::new();
51-
//! world.set_default_error_handler(my_error_handler);
52-
//!
51+
//! world.insert_resource(DefaultErrorHandler(my_error_handler));
52+
//! // Use your world here
5353
//! }
5454
//! ```
5555
//!

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ use crate::{
8989
/// A [`Command`] can return a [`Result`](crate::error::Result),
9090
/// which will be passed to an [error handler](crate::error) if the `Result` is an error.
9191
///
92-
/// The [default error handler](crate::error::default_error_handler) panics.
93-
/// It can be configured via [`set_global_default_error_handler`](crate::error::set_global_default_error_handler).
92+
/// The default error handler panics. It can be configured via
93+
/// the [`DefaultErrorHandler`](crate::error::DefaultErrorHandler) resource.
9494
///
9595
/// Alternatively, you can customize the error handler for a specific command
9696
/// by calling [`Commands::queue_handled`].
@@ -509,7 +509,7 @@ impl<'w, 's> Commands<'w, 's> {
509509
/// Pushes a generic [`Command`] to the command queue.
510510
///
511511
/// If the [`Command`] returns a [`Result`],
512-
/// it will be handled using the [default error handler](crate::error::default_error_handler).
512+
/// it will be handled using the [default error handler](crate::error::DefaultErrorHandler).
513513
///
514514
/// To use a custom error handler, see [`Commands::queue_handled`].
515515
///
@@ -695,7 +695,7 @@ impl<'w, 's> Commands<'w, 's> {
695695
/// This command will fail if any of the given entities do not exist.
696696
///
697697
/// It will internally return a [`TryInsertBatchError`](crate::world::error::TryInsertBatchError),
698-
/// which will be handled by the [default error handler](crate::error::default_error_handler).
698+
/// which will be handled by the [default error handler](crate::error::DefaultErrorHandler).
699699
#[track_caller]
700700
pub fn insert_batch<I, B>(&mut self, batch: I)
701701
where
@@ -726,7 +726,7 @@ impl<'w, 's> Commands<'w, 's> {
726726
/// This command will fail if any of the given entities do not exist.
727727
///
728728
/// It will internally return a [`TryInsertBatchError`](crate::world::error::TryInsertBatchError),
729-
/// which will be handled by the [default error handler](crate::error::default_error_handler).
729+
/// which will be handled by the [default error handler](crate::error::DefaultErrorHandler).
730730
#[track_caller]
731731
pub fn insert_batch_if_new<I, B>(&mut self, batch: I)
732732
where
@@ -1223,8 +1223,8 @@ impl<'w, 's> Commands<'w, 's> {
12231223
/// An [`EntityCommand`] can return a [`Result`](crate::error::Result),
12241224
/// which will be passed to an [error handler](crate::error) if the `Result` is an error.
12251225
///
1226-
/// The [default error handler](crate::error::default_error_handler) panics.
1227-
/// It can be configured via [`set_global_default_error_handler`](crate::error::set_global_default_error_handler).
1226+
/// The default error handler panics. It can be configured via
1227+
/// the [`DefaultErrorHandler`](crate::error::DefaultErrorHandler) resource.
12281228
///
12291229
/// Alternatively, you can customize the error handler for a specific command
12301230
/// by calling [`EntityCommands::queue_handled`].
@@ -1767,7 +1767,7 @@ impl<'a> EntityCommands<'a> {
17671767
/// Pushes an [`EntityCommand`] to the queue,
17681768
/// which will get executed for the current [`Entity`].
17691769
///
1770-
/// The [default error handler](crate::error::default_error_handler)
1770+
/// The [default error handler](crate::error::DefaultErrorHandler)
17711771
/// will be used to handle error cases.
17721772
/// Every [`EntityCommand`] checks whether the entity exists at the time of execution
17731773
/// and returns an error if it does not.

0 commit comments

Comments
 (0)