From 37985fbb244d3061d7855e306f6eb6c3e8e028a7 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 16 Feb 2019 10:17:13 +0100 Subject: [PATCH] fix the displaying of the error dialogs Exceptions which get raised in threads don't bubble up into the main code on their own. So we either communicate them to the main loop or we handle them directly in the thread. I'm going for the later for the moment because the other way seems to be quite complex. --- borg_qt/borg_interface.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/borg_qt/borg_interface.py b/borg_qt/borg_interface.py index 34ccf9f..c2a1c4c 100644 --- a/borg_qt/borg_interface.py +++ b/borg_qt/borg_interface.py @@ -5,7 +5,7 @@ import json from PyQt5.QtCore import QThread -from helper import BorgException +from helper import BorgException, show_error class BorgQtThread(QThread): @@ -46,7 +46,8 @@ class BorgQtThread(QThread): return else: err = json.loads(error) - raise BorgException(err['message']) + show_error(BorgException(err['message'])) + self.stop() class ListThread(BorgQtThread):