kopia lustrzana https://github.com/corrscope/corrscope
Show dialog if exceptions raised before playback begins
rodzic
d41f9998a3
commit
a289349d9c
|
@ -377,6 +377,7 @@ class MainWindow(qw.QMainWindow):
|
||||||
def play_thread(
|
def play_thread(
|
||||||
self, outputs: List[IOutputConfig], dlg: Optional["CorrProgressDialog"]
|
self, outputs: List[IOutputConfig], dlg: Optional["CorrProgressDialog"]
|
||||||
):
|
):
|
||||||
|
try:
|
||||||
assert self.model
|
assert self.model
|
||||||
|
|
||||||
arg = self._get_args(outputs)
|
arg = self._get_args(outputs)
|
||||||
|
@ -397,6 +398,8 @@ class MainWindow(qw.QMainWindow):
|
||||||
t.error.connect(self.on_play_thread_error)
|
t.error.connect(self.on_play_thread_error)
|
||||||
t.ffmpeg_missing.connect(self.on_play_thread_ffmpeg_missing)
|
t.ffmpeg_missing.connect(self.on_play_thread_ffmpeg_missing)
|
||||||
t.start()
|
t.start()
|
||||||
|
except Exception as e:
|
||||||
|
TracebackDialog(self).showMessage(format_stack_trace(e))
|
||||||
|
|
||||||
def _get_args(self, outputs: List[IOutputConfig]):
|
def _get_args(self, outputs: List[IOutputConfig]):
|
||||||
arg = Arguments(cfg_dir=self.cfg_dir, outputs=outputs)
|
arg = Arguments(cfg_dir=self.cfg_dir, outputs=outputs)
|
||||||
|
@ -444,6 +447,14 @@ class MainWindow(qw.QMainWindow):
|
||||||
return self.model.cfg
|
return self.model.cfg
|
||||||
|
|
||||||
|
|
||||||
|
def format_stack_trace(e):
|
||||||
|
if isinstance(e, CorrError):
|
||||||
|
stack_trace = traceback.format_exc(limit=0)
|
||||||
|
else:
|
||||||
|
stack_trace = traceback.format_exc()
|
||||||
|
return stack_trace
|
||||||
|
|
||||||
|
|
||||||
class CorrThread(qc.QThread):
|
class CorrThread(qc.QThread):
|
||||||
is_aborted: Locked[bool]
|
is_aborted: Locked[bool]
|
||||||
|
|
||||||
|
@ -472,10 +483,7 @@ class CorrThread(qc.QThread):
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
arg.on_end()
|
arg.on_end()
|
||||||
if isinstance(e, CorrError):
|
stack_trace = format_stack_trace(e)
|
||||||
stack_trace = traceback.format_exc(limit=0)
|
|
||||||
else:
|
|
||||||
stack_trace = traceback.format_exc()
|
|
||||||
self.error.emit(stack_trace)
|
self.error.emit(stack_trace)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Ładowanie…
Reference in New Issue