Skip to content

Commit 9e3fffa

Browse files
committed
Improve panic message
1 parent 6494b77 commit 9e3fffa

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

inox2d/src/params.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,12 @@ impl Param {
196196

197197
// deform specified by a parameter must be direct, i.e., in the form of displacements of all vertices
198198
let direct_deform = {
199-
let mesh = comps
200-
.get::<Mesh>(binding.node)
201-
.expect("Deform param target must have an associated Mesh.");
199+
let mesh = comps.get::<Mesh>(binding.node).unwrap_or_else(|| {
200+
panic!(
201+
"Deform param target must have an associated Mesh. (Binding Node ID: {:?})",
202+
binding.node.0
203+
)
204+
});
202205

203206
let vert_len = mesh.vertices.len();
204207
let mut direct_deform: Vec<Vec2> = Vec::with_capacity(vert_len);

0 commit comments

Comments
 (0)