about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAbdo Roig-Maranges <abdo.roig@gmail.com>2013-02-13 11:26:12 +0100
committerhut <hut@lavabit.com>2013-02-15 22:40:24 +0100
commite09d42e3e49f1a78b141ff8b47c3fc3e82085f5b (patch)
tree57e4488801a6e5a872bcfd4a4d8d8de580587f9d
parentc7abe0d4b4078adc1fff73cd19ffd6e3f8cd0c10 (diff)
downloadranger-e09d42e3e49f1a78b141ff8b47c3fc3e82085f5b.tar.gz
Handle VcsError when scanning dir. Don't raise
-rw-r--r--ranger/fsobject/directory.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index fa5db6cf..8381634e 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -17,6 +17,7 @@ from ranger.ext.accumulator import Accumulator
 from ranger.ext.lazy_property import lazy_property
 from ranger.ext.human_readable import human_readable
 from ranger.container.settingobject import LocalSettingObject
+from ranger.vcs import VcsError
 
 def sort_by_basename(path):
     """returns path.basename (for sorting)"""
@@ -272,9 +273,13 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
                                     item.vcsbranch = self.vcsbranch
                                     item.vcshead = self.vcshead
                                 item.vcsfilestatus = item.vcs.get_file_status(item.path)
-                            except:
-                                raise
-                                self.fm.notify("Can not load vcs data on %s" % item.path, bad=True)
+                            except VcsError as err:
+                                item.vcsbranch = None
+                                item.vcshead = None
+                                item.vcsremotestatus = 'unknown'
+                                item.vcsfilestatus = 'unknown'
+
+                                self.fm.notify("Can not load vcs data on %s: %s" % (item.path, err), bad=True)
 
                     files.append(item)
                     self.percent = 100 * len(files) // len(filenames)