# HG changeset patch # User Mads Kiilerich # Date 1583517746 -3600 # Node ID 5b8678cf4e0070ecfcca0ddc5eb104e6ff1227d3 # Parent 352056907cfd9329a76c3f9a411b4fed1175e46f utils: don't raise NotImplementedError in is_valid_repo_uri when the user provides an "invalid" URL We prefer to reserve NotImplementedError for programming errors that allow access to unsupported corner cases in code. diff -r 352056907cfd -r 5b8678cf4e00 kallithea/lib/utils.py --- a/kallithea/lib/utils.py Sun Mar 01 21:40:32 2020 +0100 +++ b/kallithea/lib/utils.py Fri Mar 06 19:02:26 2020 +0100 @@ -240,7 +240,7 @@ 'The "hgsubversion" library is missing')) svnremoterepo(ui, url).svn.uuid elif url.startswith('git+http'): - raise NotImplementedError() + raise InvalidCloneUriException('URI type %s not implemented' % (url,)) else: raise InvalidCloneUriException('URI %s not allowed' % (url,)) @@ -250,9 +250,9 @@ # or does it pass basic auth GitRepository._check_url(url) elif url.startswith('svn+http'): - raise NotImplementedError() + raise InvalidCloneUriException('URI type %s not implemented' % (url,)) elif url.startswith('hg+http'): - raise NotImplementedError() + raise InvalidCloneUriException('URI type %s not implemented' % (url,)) else: raise InvalidCloneUriException('URI %s not allowed' % (url))