Fix AttributeError when can not connect to Gerrit
Change-Id: I0c29bc29b9364c8203184a4dedc397e71e7ed437 Story: #2000586
This commit is contained in:
@@ -353,6 +353,8 @@ Particular patchset cannot be fetched from the remote git repository.
|
|||||||
Specified patchset number not found in the changeset.
|
Specified patchset number not found in the changeset.
|
||||||
.It 39
|
.It 39
|
||||||
Invalid patchsets for comparison.
|
Invalid patchsets for comparison.
|
||||||
|
.It 40
|
||||||
|
Connection to Gerrit was closed.
|
||||||
.It 64
|
.It 64
|
||||||
Cannot checkout downloaded patchset into the new branch.
|
Cannot checkout downloaded patchset into the new branch.
|
||||||
.It 65
|
.It 65
|
||||||
|
|||||||
@@ -388,8 +388,9 @@ def add_remote(scheme, hostname, port, project, remote, usepushurl):
|
|||||||
remote_url = make_remote_url(scheme, username, hostname, port, project)
|
remote_url = make_remote_url(scheme, username, hostname, port, project)
|
||||||
print("Trying again with %s" % remote_url)
|
print("Trying again with %s" % remote_url)
|
||||||
if not test_remote_url(remote_url):
|
if not test_remote_url(remote_url):
|
||||||
raise GitReviewException("Could not connect to gerrit at "
|
raise GerritConnectionException(
|
||||||
"%s" % remote_url)
|
"Could not connect to gerrit at %s" % remote_url
|
||||||
|
)
|
||||||
asked_for_username = True
|
asked_for_username = True
|
||||||
|
|
||||||
if usepushurl:
|
if usepushurl:
|
||||||
@@ -1054,6 +1055,11 @@ class PatchSetNotFound(ChangeSetException):
|
|||||||
EXIT_CODE = 38
|
EXIT_CODE = 38
|
||||||
|
|
||||||
|
|
||||||
|
class GerritConnectionException(GitReviewException):
|
||||||
|
"""Problem to establish connection to gerrit."""
|
||||||
|
EXIT_CODE = 40
|
||||||
|
|
||||||
|
|
||||||
class CheckoutNewBranchFailed(CommandFailed):
|
class CheckoutNewBranchFailed(CommandFailed):
|
||||||
"Cannot checkout to new branch"
|
"Cannot checkout to new branch"
|
||||||
EXIT_CODE = 64
|
EXIT_CODE = 64
|
||||||
|
|||||||
Reference in New Issue
Block a user