We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 515e0e8 + 4d1d52c commit ae64f12Copy full SHA for ae64f12
crates/wasm-rquickjs/skeleton/src/internal.rs
@@ -671,7 +671,13 @@ pub fn format_js_exception(exc: &Value) -> String {
671
}
672
673
pub fn try_format_js_error(err: &Value) -> Option<String> {
674
+ let error_ctor: Object = err.ctx().globals().get("Error").ok()?;
675
let obj = err.as_object()?;
676
+
677
+ if !obj.is_instance_of(error_ctor) {
678
+ return None;
679
+ }
680
681
let message: Option<String> = obj.get("message").ok();
682
let stack: Option<String> = obj.get("stack").ok();
683
0 commit comments