Improved error messaging

This commit is contained in:
Syrus Akbary 2018-11-13 18:41:51 -08:00
parent 3aa205aad2
commit c452ff1c04
2 changed files with 4 additions and 4 deletions

View File

@ -69,7 +69,7 @@ fn execute_wasm(wasm_path: PathBuf) -> Result<(), String> {
let import_object = integrations::generate_libc_env();
let webassembly::ResultObject { module, instance } =
webassembly::instantiate(wasm_binary, import_object)
.map_err(|err| String::from(err.description()))?;
.map_err(|err| format!("{}", err))?;
webassembly::utils::print_instance_offsets(&instance);

View File

@ -14,17 +14,17 @@ error_chain! {
errors {
CompileError(reason: String) {
description("WebAssembly compilation error")
display("Compilation error: '{:?}'", reason)
display("Compilation error: {}", reason)
}
LinkError(reason: String) {
description("WebAssembly link error")
display("Link error: '{:?}'", reason)
display("Link error: {}", reason)
}
RuntimeError(reason: String) {
description("WebAssembly runtime error")
display("Runtime error: '{:?}'", reason)
display("Runtime error: {}", reason)
}
}
}