Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix wasm errors
  • Loading branch information
coolreader18 committed Jul 27, 2019
commit ec6c016fa56d6c9c7f6f2e3518ceeab5dacec0d4
10 changes: 3 additions & 7 deletions wasm/lib/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ pub fn py_err_to_js_err(vm: &VirtualMachine, py_err: &PyObjectRef) -> JsValue {
}
};
}
let msg = match vm
.get_attribute(py_err.clone(), "msg")
.ok()
.and_then(|msg| vm.to_pystr(&msg).ok())
{
Some(msg) => msg,
None => return js_sys::Error::new("error getting error").into(),
let msg = match vm.to_pystr(py_err) {
Ok(msg) => msg,
Err(_) => return js_sys::Error::new("error getting error").into(),
};
let js_err = map_exceptions!(py_err,& msg, {
// TypeError is sort of a catch-all for "this value isn't what I thought it was like"
Expand Down