Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Unified Diff: tools/telemetry/telemetry/core/memory_cache_http_server.py

Issue 386963006: [Telemetry] Suppress red-herring error messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/memory_cache_http_server.py
diff --git a/tools/telemetry/telemetry/core/memory_cache_http_server.py b/tools/telemetry/telemetry/core/memory_cache_http_server.py
index 130ec811af16acb04ae99a20510ef9df5401a3a7..eaa812dc4f8ad311aeeac121c3f56f4b43aa01db 100644
--- a/tools/telemetry/telemetry/core/memory_cache_http_server.py
+++ b/tools/telemetry/telemetry/core/memory_cache_http_server.py
@@ -3,10 +3,12 @@
# found in the LICENSE file.
import BaseHTTPServer
+import errno
import gzip
import mimetypes
import os
import SimpleHTTPServer
+import socket
import SocketServer
import StringIO
import sys
@@ -24,6 +26,16 @@ class MemoryCacheHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
protocol_version = 'HTTP/1.1' # override BaseHTTPServer setting
wbufsize = -1 # override StreamRequestHandler (a base class) setting
+ def handle(self):
+ try:
+ BaseHTTPServer.BaseHTTPRequestHandler.handle(self)
+ except socket.error, e:
+ # Connection reset errors happen all the time due to the browser closing
+ # without terminating the connection properly. They can be safely
+ # ignored.
+ if e[0] != errno.ECONNRESET:
+ raise
+
def do_GET(self):
"""Serve a GET request."""
resource_range = self.SendHead()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698