mirror of
https://github.com/bevyengine/bevy.git
synced 2026-05-06 06:06:42 -04:00
a5cbc9e6a3
# Objective Add constructors for making `BevyError`s with a specific severity. Closes #23676. ## Solution Add a `new` constructor plus 1 constructor for every possible `Severity`. ## Testing My eyes and a simple test case that constructs an error and tests if the downcasting works. --- ## Showcase A `BevyError` now has multiple constructor to create one with an expected severity ```rust use bevy::ecs::error::{BevyError, Severity}; let debug_error = BevyError::new(Severity::Debug, "This works with strings"); let warn_error = BevyError::warn("There's a constructor for each severity level"); ``` --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: Ben Frankel <ben.frankel7@gmail.com>