Changeset - 5b8678cf4e00
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2020-03-06 19:02:26
mads@kiilerich.com
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.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/utils.py
Show inline comments
 
@@ -240,7 +240,7 @@ def is_valid_repo_uri(repo_type, url, ui
 
                                                '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 @@ def is_valid_repo_uri(repo_type, url, ui
 
            # 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))
 

	
0 comments (0 inline, 0 general)