From e09d42e3e49f1a78b141ff8b47c3fc3e82085f5b Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Wed, 13 Feb 2013 11:26:12 +0100 Subject: Handle VcsError when scanning dir. Don't raise --- ranger/fsobject/directory.py | 11 ++++++++--- 1 file 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) -- cgit 1.4.1-2-gfad0