From 90676b5c5b63bc9a0ced9da28807355f487bb0e7 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Fri, 24 May 2019 14:24:00 +0200 Subject: [PATCH 1/2] feat(runtime-c-api) `wasmer_instantiate` raises the source error. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of returning only “error instanting”, `wasmer_instantiate` can return the real error message. --- lib/runtime-c-api/src/instance.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/runtime-c-api/src/instance.rs b/lib/runtime-c-api/src/instance.rs index dfd7f2a14ce..e9611307d0b 100644 --- a/lib/runtime-c-api/src/instance.rs +++ b/lib/runtime-c-api/src/instance.rs @@ -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; } }; From dc6a53bff7fb616a90f9a0ea26c24de6ede99f3f Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Fri, 24 May 2019 14:28:37 +0200 Subject: [PATCH 2/2] chore(changelog) Add #467. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b000feea19..93857f7d870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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