mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-16 17:18:57 +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:
@@ -8,6 +8,9 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C
|
||||
|
||||
## **Unreleased**
|
||||
|
||||
### Fixed
|
||||
- [#2829](https://github.com/wasmerio/wasmer/pull/2829) Improve error message oriented from JS object.
|
||||
|
||||
## 2.2.1 - 2022/03/15
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -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