mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-27 15:41:33 +00:00
feat(runtime-c-api) Improve error message when compiling a module.
This commit is contained in:
@ -129,14 +129,14 @@ pub unsafe extern "C" fn wasmer_module_instantiate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let module = &*(module as *const Module);
|
let module = &*(module as *const Module);
|
||||||
let new_instance = if let Ok(res) = module.instantiate(&import_object) {
|
let new_instance = match module.instantiate(&import_object) {
|
||||||
res
|
Ok(instance) => instance,
|
||||||
} else {
|
Err(error) => {
|
||||||
update_last_error(CApiError {
|
update_last_error(error);
|
||||||
msg: "error instantiating from module".to_string(),
|
return wasmer_result_t::WASMER_ERROR;
|
||||||
});
|
}
|
||||||
return wasmer_result_t::WASMER_ERROR;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
*instance = Box::into_raw(Box::new(new_instance)) as *mut wasmer_instance_t;
|
*instance = Box::into_raw(Box::new(new_instance)) as *mut wasmer_instance_t;
|
||||||
wasmer_result_t::WASMER_OK
|
wasmer_result_t::WASMER_OK
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user