GUI popup for uncaught asyncio loop exceptions
This commit is contained in:
@@ -16,12 +16,12 @@ BoxPopup {
|
||||
|
||||
|
||||
property string errorType
|
||||
property var errorArguments: []
|
||||
property string message: ""
|
||||
property string traceback: ""
|
||||
|
||||
|
||||
HScrollableTextArea {
|
||||
text: traceback || qsTr("No traceback available")
|
||||
text: [message, traceback].join("\n\n") || qsTr("No info available")
|
||||
area.readOnly: true
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
@@ -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