Skip to content

Commit 5ba5c8e

Browse files
committed
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.
1 parent f1be89d commit 5ba5c8e

File tree

1 file changed

+3
-5
lines changed
  • crates/bevy_render/src/mesh/mesh

1 file changed

+3
-5
lines changed

crates/bevy_render/src/mesh/mesh/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,13 @@ impl Mesh {
110110
attribute: MeshVertexAttribute,
111111
values: impl Into<VertexAttributeValues>,
112112
) {
113-
let values: VertexAttributeValues = values.into();
114-
113+
let values = values.into();
115114
let values_format = VertexFormat::from(&values);
116115
if values_format != attribute.format {
117-
error!(
118-
"Invalid attribute format for {}. Given format is {:?} but expected {:?}",
116+
panic!(
117+
"Failed to insert attribute. Invalid attribute format for {}. Given format is {:?} but expected {:?}",
119118
attribute.name, values_format, attribute.format
120119
);
121-
panic!("Failed to insert attribute");
122120
}
123121

124122
self.attributes

0 commit comments

Comments
 (0)