Commit 8dd1f99b authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Catch RemoteDisconnected on upload metrics

It's possible that remote closes connection, which would result in a
stacktrace being shown in the stderr. Silence this exception, as we do
with other exceptions.

R=gavinmak@google.com

Bug: 1328518
Change-Id: Ifae2aca64fe5d572c0b71008f6dacbb63ba77e06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3664178Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
parent 26a1d24c
......@@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import http
import os
import sys
import urllib.error
......@@ -22,7 +23,8 @@ def main():
url=metrics_utils.APP_URL + '/upload',
data=metrics.encode('utf-8'),
headers=headers))
except (urllib.error.HTTPError, urllib.error.URLError):
except (urllib.error.HTTPError, urllib.error.URLError,
http.client.RemoteDisconnected):
pass
return 0
......
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