mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
Improved error messaging
This commit is contained in:
parent
3aa205aad2
commit
c452ff1c04
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user