Fix loop exceptions not printed in terminal
This commit is contained in:
parent
8d5bc45ceb
commit
b1144572aa
|
@ -31,7 +31,7 @@ QtObject {
|
||||||
|
|
||||||
onError ?
|
onError ?
|
||||||
onError(type, args, error, traceback, uuid) :
|
onError(type, args, error, traceback, uuid) :
|
||||||
utils.showError(type, traceback, uuid)
|
utils.showError(type, traceback, "", uuid)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -43,19 +43,7 @@ QtObject {
|
||||||
function onLoopException(message, error, traceback) {
|
function onLoopException(message, error, traceback) {
|
||||||
// No need to log these here, the asyncio exception handler does it
|
// No need to log these here, the asyncio exception handler does it
|
||||||
const type = py.getattr(py.getattr(error, "__class__"), "__name__")
|
const type = py.getattr(py.getattr(error, "__class__"), "__name__")
|
||||||
|
utils.showError(type, traceback, message)
|
||||||
if (window.hideErrorTypes.has(type)) {
|
|
||||||
console.warn(
|
|
||||||
"Not showing error popup for this type due to user choice"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
utils.makePopup(
|
|
||||||
"Popups/UnexpectedErrorPopup.qml",
|
|
||||||
window,
|
|
||||||
{ errorType: type, message, traceback },
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ QtObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function showError(type, traceback, sourceIndication="") {
|
function showError(type, traceback, sourceIndication="", message="") {
|
||||||
console.error(`python: ${sourceIndication}\n${traceback}`)
|
console.error(`python: ${sourceIndication}\n${traceback}`)
|
||||||
|
|
||||||
if (window.hideErrorTypes.has(type)) {
|
if (window.hideErrorTypes.has(type)) {
|
||||||
|
@ -72,7 +72,7 @@ QtObject {
|
||||||
utils.makePopup(
|
utils.makePopup(
|
||||||
"Popups/UnexpectedErrorPopup.qml",
|
"Popups/UnexpectedErrorPopup.qml",
|
||||||
window,
|
window,
|
||||||
{ errorType: type, traceback },
|
{ errorType: type, message, traceback },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user