mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-25 14:41:32 +00:00
feat(runtime-c-api) wasmer_instantiate
raises the source error.
Instead of returning only “error instanting”, `wasmer_instantiate` can return the real error message.
This commit is contained in:
@ -99,12 +99,8 @@ pub unsafe extern "C" fn wasmer_instantiate(
|
|||||||
let result = wasmer_runtime::instantiate(bytes, &import_object);
|
let result = wasmer_runtime::instantiate(bytes, &import_object);
|
||||||
let new_instance = match result {
|
let new_instance = match result {
|
||||||
Ok(instance) => instance,
|
Ok(instance) => instance,
|
||||||
Err(_error) => {
|
Err(error) => {
|
||||||
// TODO the trait bound `wasmer_runtime::error::Error: std::error::Error` is not satisfied
|
update_last_error(error);
|
||||||
//update_last_error(error);
|
|
||||||
update_last_error(CApiError {
|
|
||||||
msg: "error instantiating".to_string(),
|
|
||||||
});
|
|
||||||
return wasmer_result_t::WASMER_ERROR;
|
return wasmer_result_t::WASMER_ERROR;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user