diff --git a/gerrit_util.py b/gerrit_util.py index c7555e5e7..39c3aef6d 100644 --- a/gerrit_util.py +++ b/gerrit_util.py @@ -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 diff --git a/git_cl.py b/git_cl.py index c04defad8..ead1cd1f9 100755 --- a/git_cl.py +++ b/git_cl.py @@ -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: