diff --git a/kallithea/lib/utils.py b/kallithea/lib/utils.py --- a/kallithea/lib/utils.py +++ b/kallithea/lib/utils.py @@ -36,6 +36,7 @@ from distutils.version import StrictVers import beaker.cache import mercurial.config +import mercurial.error import mercurial.ui import kallithea.config.conf @@ -235,6 +236,8 @@ def is_valid_repo_uri(repo_type, url, ui MercurialRepository._check_url(url, ui) except urllib.error.URLError as e: raise InvalidCloneUriException('URI %s URLError: %s' % (url, e)) + except mercurial.error.RepoError as e: + raise InvalidCloneUriException('Mercurial %s: %s' % (type(e).__name__, safe_str(bytes(e)))) elif url.startswith('svn+http'): try: from hgsubversion.svnrepo import svnremoterepo