summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2016-10-31 00:52:42 +0100
committernfnty <git@nfnty.se>2016-10-31 01:34:39 +0100
commit0476360b9c68ccf602c9d166b8dc99311f894405 (patch)
tree72e7d4ad98fbdc3bd6c783de334a76286f714faf
parent041856327c0d9b1fe3f26c5447995fda477c657f (diff)
downloadranger-0476360b9c68ccf602c9d166b8dc99311f894405.tar.gz
VCS: Handle exceptions
-rw-r--r--ranger/ext/vcs/vcs.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py
index 9c7be653..cb8137e3 100644
--- a/ranger/ext/vcs/vcs.py
+++ b/ranger/ext/vcs/vcs.py
@@ -460,15 +460,20 @@ class VcsThread(threading.Thread):  # pylint: disable=too-many-instance-attribut
             self.paused.clear()
             self.awoken.clear()
 
-            self._queue_process()
-
-            if self.redraw:
-                self.redraw = False
-                for column in self.ui.browser.columns:
-                    if column.target and column.target.is_directory:
-                        column.need_redraw = True
-                self.ui.status.need_redraw = True
-                self.ui.redraw()
+            try:
+                self._queue_process()
+
+                if self.redraw:
+                    self.redraw = False
+                    for column in self.ui.browser.columns:
+                        if column.target and column.target.is_directory:
+                            column.need_redraw = True
+                    self.ui.status.need_redraw = True
+                    self.ui.redraw()
+            except Exception:  # pylint: disable=broad-except
+                import traceback
+                self.ui.fm.log.extendleft(reversed(traceback.format_exc().splitlines()))
+                self.ui.fm.notify('VCS Exception', bad=True)
 
     def pause(self):
         """Pause thread"""