mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-16 00:00:49 +00:00
replace panics with return Err()
This commit is contained in:
parent
8965314529
commit
4406fbb6f3
@ -634,7 +634,7 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
|
||||
|
||||
if let Err(ref err) = result {
|
||||
match err {
|
||||
RuntimeError::Trap { msg } => panic!("wasm trap occured: {}", msg),
|
||||
RuntimeError::Trap { msg } => return Err(format!("wasm trap occured: {}", msg)),
|
||||
#[cfg(feature = "wasi")]
|
||||
RuntimeError::Error { data } => {
|
||||
if let Some(error_code) = data.downcast_ref::<wasmer_wasi::ExitCode>() {
|
||||
@ -644,7 +644,7 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
|
||||
#[cfg(not(feature = "wasi"))]
|
||||
RuntimeError::Error { .. } => (),
|
||||
}
|
||||
panic!("error: {:?}", err)
|
||||
return Err(format!("error: {:?}", err))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user