GUI popup for uncaught asyncio loop exceptions
This commit is contained in:
@@ -47,7 +47,7 @@ QtObject {
|
||||
utils.makePopup(
|
||||
"Popups/UnexpectedErrorPopup.qml",
|
||||
window,
|
||||
{ errorType: type, errorArguments: args, traceback },
|
||||
{ errorType: type, traceback },
|
||||
)
|
||||
}
|
||||
|
||||
@@ -55,6 +55,25 @@ QtObject {
|
||||
}
|
||||
|
||||
|
||||
function onLoopException(message, error, traceback) {
|
||||
// No need to log these here, the asyncio exception handler does it
|
||||
const type = py.getattr(py.getattr(error, "__class__"), "__name__")
|
||||
|
||||
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 },
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
function onModelUpdated(syncId, data, serializedSyncId) {
|
||||
if (serializedSyncId === "Account" || serializedSyncId[0] === "Room") {
|
||||
py.callCoro("get_flat_mainpane_data", [], data => {
|
||||
|
Reference in New Issue
Block a user