Skip to content

Commit 8dd1f99

Browse files
sokcevicGLUCI CQ
authored and
LUCI CQ
committed
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. [email protected] Bug: 1328518 Change-Id: Ifae2aca64fe5d572c0b71008f6dacbb63ba77e06 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3664178 Reviewed-by: Gavin Mak <[email protected]> Auto-Submit: Josip Sokcevic <[email protected]> Commit-Queue: Gavin Mak <[email protected]>
1 parent 26a1d24 commit 8dd1f99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

upload_metrics.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6+
import http
67
import os
78
import sys
89
import urllib.error
@@ -22,7 +23,8 @@ def main():
2223
url=metrics_utils.APP_URL + '/upload',
2324
data=metrics.encode('utf-8'),
2425
headers=headers))
25-
except (urllib.error.HTTPError, urllib.error.URLError):
26+
except (urllib.error.HTTPError, urllib.error.URLError,
27+
http.client.RemoteDisconnected):
2628
pass
2729

2830
return 0

0 commit comments

Comments
 (0)