summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-08-30 14:22:34 +0000
committerGerrit Code Review <review@openstack.org>2016-08-30 14:22:34 +0000
commit8cdabbf90d5a50c69a8fc24682c2645e2c0a3d88 (patch)
tree9c3e5862c83ef449d996f4d763f74303b1f2de81
parentcc0fbc286ef7be29e26173f349a0bf5aaca5f976 (diff)
parent9ebdef990d2548591ff04ca2811f240fa264a0cd (diff)
downloadgit-review-8cdabbf90d5a50c69a8fc24682c2645e2c0a3d88.tar.gz
Merge "Fix AttributeError when can not connect to Gerrit"
-rw-r--r--git-review.12
-rwxr-xr-xgit_review/cmd.py10
2 files changed, 10 insertions, 2 deletions
diff --git a/git-review.1 b/git-review.1
index b24a90c..e7afcf4 100644
--- a/git-review.1
+++ b/git-review.1
@@ -370,6 +370,8 @@ Particular patchset cannot be fetched from the remote git repository.
Specified patchset number not found in the changeset.
.It 39
Invalid patchsets for comparison.
+.It 40
+Connection to Gerrit was closed.
.It 64
Cannot checkout downloaded patchset into the new branch.
.It 65
diff --git a/git_review/cmd.py b/git_review/cmd.py
index 563e55f..f39d50c 100755
--- a/git_review/cmd.py
+++ b/git_review/cmd.py
@@ -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