diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-12-17 22:53:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-17 22:53:05 +0100 |
commit | 504c289ad0d670fbdc0fb0f598d2e693cda9f5f7 (patch) | |
tree | fe72f99d69f04c3238bc6a33961701e4bc3aa3d9 | |
parent | 975d1b87a3c0531e196084434a168644d9c187f9 (diff) | |
parent | 5cfc728d2e25b2663697075226d9310dbee5efc6 (diff) | |
download | mitmproxy-504c289ad0d670fbdc0fb0f598d2e693cda9f5f7.tar.gz mitmproxy-504c289ad0d670fbdc0fb0f598d2e693cda9f5f7.tar.bz2 mitmproxy-504c289ad0d670fbdc0fb0f598d2e693cda9f5f7.zip |
Merge pull request #1875 from Kriechi/dont-log-tracebacks
don't log full tracebacks
-rw-r--r-- | mitmproxy/proxy/protocol/http2.py | 3 | ||||
-rw-r--r-- | mitmproxy/proxy/protocol/http_replay.py | 6 | ||||
-rw-r--r-- | mitmproxy/proxy/server.py | 3 |
3 files changed, 3 insertions, 9 deletions
diff --git a/mitmproxy/proxy/protocol/http2.py b/mitmproxy/proxy/protocol/http2.py index 45e55955..b7548221 100644 --- a/mitmproxy/proxy/protocol/http2.py +++ b/mitmproxy/proxy/protocol/http2.py @@ -1,6 +1,5 @@ import threading import time -import traceback import functools from typing import Dict, Callable, Any, List # noqa @@ -358,7 +357,6 @@ class Http2Layer(base.Layer): self._cleanup_streams() except Exception as e: # pragma: no cover self.log(repr(e), "info") - self.log(traceback.format_exc(), "debug") self._kill_all_streams() @@ -624,7 +622,6 @@ class Http2SingleStreamLayer(httpbase._HttpTransmissionLayer, basethread.BaseThr pass except exceptions.ProtocolException as e: # pragma: no cover self.log(repr(e), "info") - self.log(traceback.format_exc(), "debug") except exceptions.SetServerNotAllowedException as e: # pragma: no cover self.log("Changing the Host server for HTTP/2 connections not allowed: {}".format(e), "info") except exceptions.Kill: diff --git a/mitmproxy/proxy/protocol/http_replay.py b/mitmproxy/proxy/protocol/http_replay.py index 2e4c91b0..38f511c4 100644 --- a/mitmproxy/proxy/protocol/http_replay.py +++ b/mitmproxy/proxy/protocol/http_replay.py @@ -1,5 +1,3 @@ -import traceback - from mitmproxy import log from mitmproxy import controller from mitmproxy import exceptions @@ -107,10 +105,10 @@ class RequestReplayThread(basethread.BaseThread): "log", log.LogEntry("Connection killed", "info") ) - except Exception: + except Exception as e: self.channel.tell( "log", - log.LogEntry(traceback.format_exc(), "error") + log.LogEntry(repr(e), "error") ) finally: r.first_line_format = first_line_format_backup diff --git a/mitmproxy/proxy/server.py b/mitmproxy/proxy/server.py index fc00a633..97018dad 100644 --- a/mitmproxy/proxy/server.py +++ b/mitmproxy/proxy/server.py @@ -120,7 +120,6 @@ class ConnectionHandler: except exceptions.Kill: self.log("Connection killed", "info") except exceptions.ProtocolException as e: - if isinstance(e, exceptions.ClientHandshakeException): self.log( "Client Handshake failed. " @@ -134,7 +133,7 @@ class ConnectionHandler: else: self.log(str(e), "warn") - self.log(traceback.format_exc(), "debug") + self.log(repr(e), "debug") # If an error propagates to the topmost level, # we send an HTTP error response, which is both # understandable by HTTP clients and humans. |