mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 02:35:20 +00:00
waiting dialog: handle exceptions
This commit is contained in:
parent
1189ed39ae
commit
7ceeb7e67a
1 changed files with 9 additions and 1 deletions
|
@ -21,11 +21,19 @@ class WaitingDialog(QThread):
|
|||
self.d.show()
|
||||
|
||||
def run(self):
|
||||
self.result = self.run_task()
|
||||
self.error = None
|
||||
try:
|
||||
self.result = self.run_task()
|
||||
except Exception as e:
|
||||
self.error = str(e)
|
||||
self.d.emit(SIGNAL('done'))
|
||||
|
||||
def close(self):
|
||||
self.d.accept()
|
||||
if self.error:
|
||||
QMessageBox.warning(self.parent, _('Error'), self.error, _('OK'))
|
||||
return
|
||||
|
||||
if self.on_complete:
|
||||
self.on_complete(*self.result)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue