reimplement the run method on the backup class
For some reason the BorgExceptions from the backup thread don't get caught in the main_window. Therefore I'm implementing the error handling directly in the class for the moment. This will have the side effect that the error dialog will pop up when there is a problem during a background backup. However that is anyway something I thought about implementing. This way it's just not properly implemented yet.
This commit is contained in:
parent
143f01d1e8
commit
3d222e3236
|
@ -5,7 +5,7 @@ import json
|
||||||
|
|
||||||
from PyQt5.QtCore import QThread
|
from PyQt5.QtCore import QThread
|
||||||
|
|
||||||
from helper import BorgException
|
from helper import BorgException, show_error
|
||||||
|
|
||||||
|
|
||||||
class BorgQtThread(QThread):
|
class BorgQtThread(QThread):
|
||||||
|
@ -106,6 +106,15 @@ class BackupThread(BorgQtThread):
|
||||||
if self.excludes:
|
if self.excludes:
|
||||||
self.command.extend(self.excludes)
|
self.command.extend(self.excludes)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.json_output, self.json_err = self.p.communicate()
|
||||||
|
self.p.wait()
|
||||||
|
try:
|
||||||
|
self.process_json_error(self.json_err)
|
||||||
|
except BorgException as e:
|
||||||
|
show_error(e)
|
||||||
|
self.stop()
|
||||||
|
|
||||||
def _process_prefix(self, prefix):
|
def _process_prefix(self, prefix):
|
||||||
"""Prepares the prefix for the final command."""
|
"""Prepares the prefix for the final command."""
|
||||||
if prefix:
|
if prefix:
|
||||||
|
|
Loading…
Reference in New Issue