Skip to content

fallible-algebra/bevy_ressys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bevy_ressys

Annotation macro for writing systems that return results for logging for Bevy.

This is an implementation of a potential fix for bevyengine/bevy#8638, where piping systems that return errors to the logging util systems reports the location of the error as the util system and not the system that generated the error.

#[res_system(bevy::log::warn)]
fn this_system_warns(/* args */) -> Result<(), String> {
    Err("This is a warning".to_owned())
}

Becomes

fn this_system_warns(/* args */) {
    fn inner_fn_for_res_system(/* args */) {
        Err("This is a warning".to_owned())
    }
    if let Err(err) = inner_fn_for_res_system(/* args */) {
        bevy::log::warn!(err)
    }
}

About

Result system macros for Bevy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages