Skip to content

Commit ab0e3f8

Browse files
Small cleanup for ECS error handling (#18280)
# Objective While poking at #17272, I noticed a few small things to clean up. ## Solution - Improve the docs - ~~move `SystemErrorContext` out of the `handler.rs` module: it's not an error handler~~
1 parent 25103df commit ab0e3f8

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

crates/bevy_app/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ impl App {
12761276

12771277
/// Set the global system error handler to use for systems that return a [`Result`].
12781278
///
1279-
/// See the [`bevy_ecs::result` module-level documentation](../../bevy_ecs/result/index.html)
1279+
/// See the [`bevy_ecs::error` module-level documentation](bevy_ecs::error)
12801280
/// for more information.
12811281
pub fn set_system_error_handler(
12821282
&mut self,

crates/bevy_app/src/sub_app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl SubApp {
338338

339339
/// Set the global error handler to use for systems that return a [`Result`].
340340
///
341-
/// See the [`bevy_ecs::result` module-level documentation](../../bevy_ecs/result/index.html)
341+
/// See the [`bevy_ecs::error` module-level documentation](bevy_ecs::error)
342342
/// for more information.
343343
pub fn set_system_error_handler(
344344
&mut self,

crates/bevy_ecs/src/error/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
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, either globally or
11-
//! per `Schedule`:
11+
//! per [`Schedule`]:
1212
//!
13-
//! - [`App::set_system_error_handler`] sets the global error handler for all systems of the
14-
//! current [`World`].
13+
//! - `App::set_system_error_handler` (via `bevy_app`) sets the global error handler for all systems of the
14+
//! current [`World`] by modifying the [`DefaultSystemErrorHandler`].
1515
//! - [`Schedule::set_error_handler`] sets the error handler for all systems of that schedule.
1616
//!
1717
//! Bevy provides a number of pre-built error-handlers for you to use:
@@ -76,5 +76,7 @@ mod handler;
7676
pub use bevy_error::*;
7777
pub use handler::*;
7878

79-
/// A result type for use in fallible systems.
79+
/// A result type for use in fallible systems, commands and observers.
80+
///
81+
/// The [`BevyError`] type is a type-erased error type with optional Bevy-specific diagnostics.
8082
pub type Result<T = (), E = BevyError> = core::result::Result<T, E>;

0 commit comments

Comments
 (0)