mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-13 00:51:20 +00:00
Hook up error propagation
This commit is contained in:
@ -137,15 +137,13 @@ impl std::fmt::Display for RuntimeError {
|
||||
write!(f, "WebAssembly trap occured during runtime: {}", msg)
|
||||
}
|
||||
RuntimeError::Error { data } => {
|
||||
let msg = if let Some(s) = data.downcast_ref::<String>() {
|
||||
s
|
||||
if let Some(s) = data.downcast_ref::<String>() {
|
||||
write!(f, "\"{}\"", s)
|
||||
} else if let Some(s) = data.downcast_ref::<&str>() {
|
||||
s
|
||||
write!(f, "\"{}\"", s)
|
||||
} else {
|
||||
"user-defined, opaque"
|
||||
};
|
||||
|
||||
write!(f, "{}", msg)
|
||||
write!(f, "unknown error")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user