Print python exception tracebacks

This commit is contained in:
miruka
2019-10-29 13:34:55 -04:00
parent 001d6eff71
commit 7a5a1fc650
3 changed files with 14 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ function onAlertRequested() {
}
function onCoroutineDone(uuid, result, error) {
function onCoroutineDone(uuid, result, error, traceback) {
let onSuccess = py.pendingCoroutines[uuid].onSuccess
let onError = py.pendingCoroutines[uuid].onError
@@ -22,8 +22,8 @@ function onCoroutineDone(uuid, result, error) {
let args = py.getattr(error, "args")
onError ?
onError(type, args, error) :
console.error(uuid + ": " + type + ": " + args)
onError(type, args, error, traceback) :
console.error("python:\n" + traceback)
} else if (onSuccess) { onSuccess(result) }