Merge "Fix AttributeError when can not connect to Gerrit"

This commit is contained in:
Jenkins
2016-08-30 14:22:34 +00:00
committed by Gerrit Code Review
2 changed files with 10 additions and 2 deletions

View File

@@ -393,8 +393,9 @@ def add_remote(scheme, hostname, port, project, remote, usepushurl):
remote_url = make_remote_url(scheme, username, hostname, port, project)
print("Trying again with %s" % remote_url)
if not test_remote_url(remote_url):
raise GitReviewException("Could not connect to gerrit at "
"%s" % remote_url)
raise GerritConnectionException(
"Could not connect to gerrit at %s" % remote_url
)
asked_for_username = True
if usepushurl:
@@ -1062,6 +1063,11 @@ class PatchSetNotFound(ChangeSetException):
EXIT_CODE = 38
class GerritConnectionException(GitReviewException):
"""Problem to establish connection to gerrit."""
EXIT_CODE = 40
class CheckoutNewBranchFailed(CommandFailed):
"Cannot checkout to new branch"
EXIT_CODE = 64