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:
|
||||
return http_server.BaseHTTPRequestHandler.send_error(
|
||||
self, code, message, explain)
|
||||
except:
|
||||
self.logger.error(
|
||||
'send_error(%r, %r, %r) raised exception', exc_info=True)
|
||||
except Exception as e:
|
||||
level = logging.ERROR
|
||||
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
|
||||
|
||||
def _proxy_request(self, extra_response_headers={}):
|
||||
|
Loading…
x
Reference in New Issue
Block a user