mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
avoid exception sending error to client
this is a slightly different approach to https://github.com/internetarchive/warcprox/pull/121
This commit is contained in:
parent
2ca84ae023
commit
7560c0946d
@ -415,9 +415,13 @@ class MitmProxyHandler(http_server.BaseHTTPRequestHandler):
|
|||||||
try:
|
try:
|
||||||
return http_server.BaseHTTPRequestHandler.send_error(
|
return http_server.BaseHTTPRequestHandler.send_error(
|
||||||
self, code, message, explain)
|
self, code, message, explain)
|
||||||
except:
|
except Exception as e:
|
||||||
self.logger.error(
|
level = logging.ERROR
|
||||||
'send_error(%r, %r, %r) raised exception', exc_info=True)
|
if isinstance(e, OSError) and e.errno == 9:
|
||||||
|
level = logging.TRACE
|
||||||
|
self.logger.log(
|
||||||
|
level, 'send_error(%r, %r, %r) raised exception',
|
||||||
|
exc_info=True)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _proxy_request(self, extra_response_headers={}):
|
def _proxy_request(self, extra_response_headers={}):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user