changeset 6041:0bac887ea148

changeset: don't crash with unhandled EmptyRepositoryError when visiting (non-existing) changeset in an empty repo
author Mads Kiilerich <madski@unity3d.com>
date Mon, 13 Apr 2015 15:58:56 +0200
parents 21f1237772bb
children 4949076c8bb2
files kallithea/controllers/changeset.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/changeset.py	Thu Jul 28 16:28:34 2016 +0200
+++ b/kallithea/controllers/changeset.py	Mon Apr 13 15:58:56 2015 +0200
@@ -36,7 +36,7 @@
 
 from kallithea.lib.utils import jsonify
 from kallithea.lib.vcs.exceptions import RepositoryError, \
-    ChangesetDoesNotExistError
+    ChangesetDoesNotExistError, EmptyRepositoryError
 
 from kallithea.lib.compat import json
 import kallithea.lib.helpers as h
@@ -228,7 +228,7 @@
             if not c.cs_ranges:
                 raise RepositoryError('Changeset range returned empty result')
 
-        except ChangesetDoesNotExistError:
+        except (ChangesetDoesNotExistError, EmptyRepositoryError):
             log.debug(traceback.format_exc())
             msg = _('Such revision does not exist for this repository')
             h.flash(msg, category='error')