diff --git a/crates/wasmtime/src/instance.rs b/crates/wasmtime/src/instance.rs index 2e23e79505..bc66d0308c 100644 --- a/crates/wasmtime/src/instance.rs +++ b/crates/wasmtime/src/instance.rs @@ -372,7 +372,8 @@ impl Instance { .get_export(store.as_context_mut(), name) .and_then(|f| f.into_func()) .ok_or_else(|| anyhow!("failed to find function export `{}`", name))?; - Ok(f.typed::(store)?) + Ok(f.typed::(store) + .with_context(|| format!("failed to convert function `{}` to given type", name))?) } /// Looks up an exported [`Table`] value by name.