Return compile error validation if Module is not valid wasm

This commit is contained in:
Syrus
2020-04-22 11:07:37 -07:00
parent f62f475309
commit eb68125f30

View File

@@ -85,6 +85,10 @@ impl Module {
// going to be used in development mode.
return unsafe { Module::from_binary_unchecked(store, bytes.as_ref()) };
}
Err(CompileError::Validate(
"The module is not a valid WebAssembly file.".to_string(),
))
}
pub fn from_file(store: &Store, file: impl AsRef<Path>) -> Result<Module, IoCompileError> {