mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
Improve error message oriented from JS object
`JsValue.as_string` converts the value to String iff the value is a String itself, so the error message always failovers to empty string. `JsValue` impls `Debug` using `JSON.stringify`, and it gives better description of the error.
This commit is contained in:
@@ -43,7 +43,7 @@ impl fmt::Display for RuntimeErrorSource {
|
||||
match self {
|
||||
Self::Generic(s) => write!(f, "{}", s),
|
||||
Self::User(s) => write!(f, "{}", s),
|
||||
Self::Js(s) => write!(f, "{}", s.as_string().unwrap_or("".to_string())),
|
||||
Self::Js(s) => write!(f, "{:?}", s),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user