Commit 4956f798 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

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/472906Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
parent 70909e1e
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment