Move hideErrorTypes & showError() to PythonBridge

This commit is contained in:
miruka
2020-08-03 01:19:08 -04:00
parent 040e966d27
commit c813e92ac7
9 changed files with 24 additions and 25 deletions

View File

@@ -71,4 +71,18 @@ Python {
if (callback) { callback(settings, uiState, theme) }
})
}
function showError(type, traceback, sourceIndication="", message="") {
console.error(`python: ${sourceIndication}\n${traceback}`)
if (Globals.hideErrorTypes.has(type)) {
console.info("Not showing popup for ignored error type " + type)
return
}
utils.makePopup(
"Popups/UnexpectedErrorPopup.qml",
{ errorType: type, message, traceback },
)
}
}