skip stack trace for normal-ish problems

This commit is contained in:
Noah Levitt 2015-08-11 18:06:17 +00:00
parent d3df48b97e
commit 3073d59303

View File

@ -83,13 +83,13 @@ class MitmProxyHandler(http_server.BaseHTTPRequestHandler):
self._transition_to_ssl()
except Exception as e:
try:
self.logger.error("problem handling {}: {}".format(repr(self.requestline), e), exc_info=True)
self.logger.error("problem handling {}: {}".format(repr(self.requestline), e))
if type(e) is socket.timeout:
self.send_error(504, str(e))
else:
self.send_error(500, str(e))
except Exception as f:
self.logger.warn("failed to send error response ({}) to proxy client: {}".format(e, f), exc_info=True)
self.logger.warn("failed to send error response ({}) to proxy client: {}".format(e, f))
return
# Reload!