467: feat(runtime-c-api) `wasmer_instantiate` raises the source error r=syrusakbary a=Hywan

Instead of returning only “error instanting”, `wasmer_instantiate` can
return the real error message.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
This commit is contained in:
bors[bot] 2019-05-24 18:26:04 +00:00
commit e8c9715099
2 changed files with 3 additions and 6 deletions

View File

@ -6,6 +6,7 @@ Blocks of changes will separated by version increments.
## **[Unreleased]**
- [#467](https://github.com/wasmerio/wasmer/pull/467) `wasmer_instantiate` returns better error messages in the runtime C API
- [#463](https://github.com/wasmerio/wasmer/pull/463) Fix bug in WASI path_open allowing one level above preopened dir to be accessed
- [#461](https://github.com/wasmerio/wasmer/pull/461) Prevent passing negative lengths in various places in the runtime C API
- [#459](https://github.com/wasmerio/wasmer/pull/459) Add monotonic and real time clocks for wasi on windows

View File

@ -99,12 +99,8 @@ pub unsafe extern "C" fn wasmer_instantiate(
let result = wasmer_runtime::instantiate(bytes, &import_object);
let new_instance = match result {
Ok(instance) => instance,
Err(_error) => {
// TODO the trait bound `wasmer_runtime::error::Error: std::error::Error` is not satisfied
//update_last_error(error);
update_last_error(CApiError {
msg: "error instantiating".to_string(),
});
Err(error) => {
update_last_error(error);
return wasmer_result_t::WASMER_ERROR;
}
};