Skip to content

Commit b57f257

Browse files
committed
translate exception
1 parent 0d36f65 commit b57f257

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pyjs_code_runner/js/utils.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ function eval_main_script(pyjs, workdir, filename) {
3939
return 0;
4040
}
4141
catch (e) {
42-
console.error("error while evaluating main file:", e)
42+
if (typeof e === "number") {
43+
const msg = get_exception_message(e);
44+
console.error("error while evaluating main file:", msg)
45+
}
46+
else {
47+
console.error("error while evaluating main file:", e)
48+
}
4349
return 1;
4450
}
4551
return 0

0 commit comments

Comments
 (0)