# HG changeset patch # User Mads Kiilerich # Date 2015-04-13 15:58:56 # Node ID 0bac887ea14836cf72f25b4b591eb813a8dcf9dd # Parent 21f1237772bb052015b44088e64241d6ed5e9401 changeset: don't crash with unhandled EmptyRepositoryError when visiting (non-existing) changeset in an empty repo diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py +++ b/kallithea/controllers/changeset.py @@ -36,7 +36,7 @@ from webob.exc import HTTPFound, HTTPFor 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 @@ class ChangesetController(BaseRepoContro 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')