From b1144572aab299797544ec18ba4180c48bd2b9d7 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 22 Mar 2020 20:58:24 -0400 Subject: [PATCH] Fix loop exceptions not printed in terminal --- src/gui/PythonBridge/Privates/EventHandlers.qml | 16 ++-------------- src/gui/Utils.qml | 4 ++-- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/gui/PythonBridge/Privates/EventHandlers.qml b/src/gui/PythonBridge/Privates/EventHandlers.qml index 46124d86..c5f9c62d 100644 --- a/src/gui/PythonBridge/Privates/EventHandlers.qml +++ b/src/gui/PythonBridge/Privates/EventHandlers.qml @@ -31,7 +31,7 @@ QtObject { onError ? onError(type, args, error, traceback, uuid) : - utils.showError(type, traceback, uuid) + utils.showError(type, traceback, "", uuid) return } @@ -43,19 +43,7 @@ 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 }, - ) + utils.showError(type, traceback, message) } diff --git a/src/gui/Utils.qml b/src/gui/Utils.qml index cba175d1..7e3a1b12 100644 --- a/src/gui/Utils.qml +++ b/src/gui/Utils.qml @@ -58,7 +58,7 @@ QtObject { } - function showError(type, traceback, sourceIndication="") { + function showError(type, traceback, sourceIndication="", message="") { console.error(`python: ${sourceIndication}\n${traceback}`) if (window.hideErrorTypes.has(type)) { @@ -72,7 +72,7 @@ QtObject { utils.makePopup( "Popups/UnexpectedErrorPopup.qml", window, - { errorType: type, traceback }, + { errorType: type, message, traceback }, ) }