From 871a3ec922e5bac595b3fb7a61c7f3b0b1f67b83 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Feb 2020 11:26:29 +0530 Subject: [PATCH] Better webengine render process crash handling --- src/calibre/gui2/webengine.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/webengine.py b/src/calibre/gui2/webengine.py index a2c47dcb05..2758c3518a 100644 --- a/src/calibre/gui2/webengine.py +++ b/src/calibre/gui2/webengine.py @@ -149,13 +149,16 @@ class RestartingWebEngineView(QWebEngineView): def render_process_terminated(self, termination_type, exit_code): if termination_type == QWebEnginePage.NormalTerminationStatus: return + self.webengine_crash_message = 'The Qt WebEngine Render process crashed with termination type: {} and exit code: {}'.format( + termination_type, exit_code) + prints(self.webengine_crash_message) if self._last_reload_at is not None and monotonic() - self._last_reload_at < 2: self.render_process_failed.emit() - print('The Qt WebEngine Render process crashed too often') + prints('The Qt WebEngine Render process crashed too often') else: self._last_reload_at = monotonic() self.render_process_restarted.emit() - prints('The Qt WebEngine Render process crashed, restarting it') + prints('Restarting Qt WebEngine') if __name__ == '__main__':