Skip to content

Commit ef14cc6

Browse files
committed
Fix wasm errors
1 parent 2354217 commit ef14cc6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

wasm/lib/src/convert.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,9 @@ pub fn py_err_to_js_err(vm: &VirtualMachine, py_err: &PyObjectRef) -> JsValue {
2222
}
2323
};
2424
}
25-
let msg = match vm
26-
.get_attribute(py_err.clone(), "msg")
27-
.ok()
28-
.and_then(|msg| vm.to_pystr(&msg).ok())
29-
{
30-
Some(msg) => msg,
31-
None => return js_sys::Error::new("error getting error").into(),
25+
let msg = match vm.to_pystr(py_err) {
26+
Ok(msg) => msg,
27+
Err(_) => return js_sys::Error::new("error getting error").into(),
3228
};
3329
let js_err = map_exceptions!(py_err,& msg, {
3430
// TypeError is sort of a catch-all for "this value isn't what I thought it was like"

0 commit comments

Comments
 (0)