Improve cloudtop error message on git cl failure

R=gavinmak@google.com

Fixed: 280621923
Change-Id: I856dc1eb4f3fcd65906196b66f358b1dd413012e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5547690
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
changes/90/5547690/2
Josip Sokcevic 12 months ago committed by LUCI CQ
parent 4750254802
commit ab914fad1e

@ -511,7 +511,7 @@ def ReadHttpJsonResponse(conn, accept_statuses=frozenset([200])):
# The first line of the response should always be: )]}'
s = fh.readline()
if s and s.rstrip() != ")]}'":
raise GerritError(200, 'Unexpected json output: %s' % s)
raise GerritError(200, 'Unexpected json output: %s' % s[:100])
s = fh.read()
if not s:
return None

@ -6862,6 +6862,8 @@ def main(argv):
dispatcher = subcommand.CommandDispatcher(__name__)
try:
return dispatcher.execute(OptionParser(), argv)
except gerrit_util.GerritError as e:
DieWithError(str(e))
except auth.LoginRequiredError as e:
DieWithError(str(e))
except urllib.error.HTTPError as e:

Loading…
Cancel
Save