Function bevy_ecs::system::adapter::error

source ·
pub fn error<E: Debug>(In: In<Result<(), E>>)
👎Deprecated: use .map(bevy_utils::error) instead
Expand description

System adapter that utilizes the [bevy_utils::tracing::error!] macro to print the output of a system.

Examples

use bevy_ecs::prelude::*;
// Building a new schedule/app...
let mut sched = Schedule::default();
sched.add_systems(
        // Prints system error if system fails.
        parse_error_message_system.pipe(system_adapter::error)
    )
    // ...

// A system that returns a Result<())> output.
fn parse_error_message_system() -> Result<(), String> {
   Err("Some error".to_owned())
}