diff options
author | nfnty <git@nfnty.se> | 2016-10-31 00:52:42 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2016-10-31 01:34:39 +0100 |
commit | 0476360b9c68ccf602c9d166b8dc99311f894405 (patch) | |
tree | 72e7d4ad98fbdc3bd6c783de334a76286f714faf /ranger | |
parent | 041856327c0d9b1fe3f26c5447995fda477c657f (diff) | |
download | ranger-0476360b9c68ccf602c9d166b8dc99311f894405.tar.gz |
VCS: Handle exceptions
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/ext/vcs/vcs.py | 23 |
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""" |