diff --git a/src/commands/run.rs b/src/commands/run.rs index cafd7f19f8..2ddf47fe00 100644 --- a/src/commands/run.rs +++ b/src/commands/run.rs @@ -264,10 +264,10 @@ impl RunCommand { }) .collect::, _>>()?; - let instance = HostRef::new(match Instance::new(store, &module, &imports) { - Ok(instance) => instance, - Err(trap) => bail!("Failed to instantiate {:?}: {:?}", path, trap), - }); + let instance = HostRef::new( + Instance::new(store, &module, &imports) + .context(format!("failed to instantiate {:?}", path))?, + ); Ok((instance, module, data)) }