mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 14:40:19 +00:00
insert_attribute panic with full message (#5651)
# Objective When an invalid attribute is inserted and the LogPlugin is not enabled the full error is not printed which means makes it hard to diagnose. ## Solution - Always print the full message in the panic. ## Notes I originally had a separate error log because I wanted to make it clearer for users, but this is probably causing more issues than necessary.
This commit is contained in:
parent
f1be89d458
commit
5ba5c8e375
1 changed files with 3 additions and 5 deletions
|
@ -110,15 +110,13 @@ impl Mesh {
|
|||
attribute: MeshVertexAttribute,
|
||||
values: impl Into<VertexAttributeValues>,
|
||||
) {
|
||||
let values: VertexAttributeValues = values.into();
|
||||
|
||||
let values = values.into();
|
||||
let values_format = VertexFormat::from(&values);
|
||||
if values_format != attribute.format {
|
||||
error!(
|
||||
"Invalid attribute format for {}. Given format is {:?} but expected {:?}",
|
||||
panic!(
|
||||
"Failed to insert attribute. Invalid attribute format for {}. Given format is {:?} but expected {:?}",
|
||||
attribute.name, values_format, attribute.format
|
||||
);
|
||||
panic!("Failed to insert attribute");
|
||||
}
|
||||
|
||||
self.attributes
|
||||
|
|
Loading…
Reference in a new issue