git cl: suggest git cl creds-check if Gerrit API returns 401.

R=sergiyb@chromium.org
BUG=708785

Change-Id: Id25d3ef9a1449a0c259ed48b782e1b766e1a5fc9
Reviewed-on: https://chromium-review.googlesource.com/472906
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
changes/06/472906/3
Andrii Shyshkalov 8 years ago committed by Commit Bot
parent 70909e1ed3
commit 4956f798fb

@ -368,6 +368,9 @@ def ReadHttpResponse(conn, expect_status=200, ignore_404=True):
if ignore_404 and response.status == 404:
return StringIO()
if response.status != expect_status:
if response.status in (401, 403):
print('Your Gerrit credentials might be misconfigured. Try: \n'
' git cl creds-check')
reason = '%s: %s' % (response.reason, contents)
raise GerritError(response.status, reason)
return StringIO(contents)

Loading…
Cancel
Save