# HG changeset patch # User Marcin Kuzminski # Date 2016-12-01 16:50:10 # Node ID 5cc9bd9ae79aefbb8a0855f0eabb9df36bb4bc84 # Parent b63df6554bb6704686ce54026b8e1debbd9a287f vcs: raise better exception if file node history cannot be extracted. reference: #4664 diff --git a/rhodecode/lib/vcs/backends/base.py b/rhodecode/lib/vcs/backends/base.py --- a/rhodecode/lib/vcs/backends/base.py +++ b/rhodecode/lib/vcs/backends/base.py @@ -830,7 +830,13 @@ class BaseCommit(object): :param pre_load: Optional. List of commit attributes to load. """ - return self.get_file_history(path, limit=1, pre_load=pre_load)[0] + commits = self.get_file_history(path, limit=1, pre_load=pre_load) + if not commits: + raise RepositoryError( + 'Failed to fetch history for path {}. ' + 'Please check if such path exists in your repository'.format( + path)) + return commits[0] def get_file_history(self, path, limit=None, pre_load=None): """