Add special error types for compile, linking, and runtime errors. (#99)

* Add error types and convert most results to wasmer-runtime results

* Fix spectests

* Fix umbrella project to work with new error types
This commit is contained in:
Lachlan Sneff
2019-01-18 10:54:16 -08:00
committed by GitHub
parent 9c0d78ae46
commit 8a9f5fa61a
18 changed files with 394 additions and 179 deletions

View File

@ -2,6 +2,7 @@ use wabt::wat2wasm;
use wasmer_clif_backend::CraneliftCompiler;
use wasmer_runtime::{
self as runtime,
error::Result,
export::{Context, Export, FuncPointer},
import::{Imports, NamespaceMap},
types::{FuncSig, Type, Value},
@ -10,7 +11,7 @@ use wasmer_runtime::{
static EXAMPLE_WASM: &'static [u8] = include_bytes!("simple.wasm");
fn main() -> Result<(), String> {
fn main() -> Result<()> {
let wasm_binary = wat2wasm(IMPORT_MODULE.as_bytes()).expect("WAST not valid or malformed");
let inner_module = runtime::compile(&wasm_binary, &CraneliftCompiler::new())?;