diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-17 02:13:28 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-17 02:13:28 +0200 |
commit | 14a5f405fdf3973f05ca11182e927d145d10d8d6 (patch) | |
tree | 2843010882d64d928c0f53edffa9f8d48cee6da0 /libmproxy/protocol/http.py | |
parent | 8fbed971ae4a84e875f1072805b17cc7ada39fad (diff) | |
download | mitmproxy-14a5f405fdf3973f05ca11182e927d145d10d8d6.tar.gz mitmproxy-14a5f405fdf3973f05ca11182e927d145d10d8d6.tar.bz2 mitmproxy-14a5f405fdf3973f05ca11182e927d145d10d8d6.zip |
use new netlib exceptions
Diffstat (limited to 'libmproxy/protocol/http.py')
-rw-r--r-- | libmproxy/protocol/http.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index a876df41..baccec8c 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -6,10 +6,10 @@ import traceback import six from netlib import tcp -from netlib.exceptions import HttpException, HttpReadDisconnect +from netlib.exceptions import HttpException, HttpReadDisconnect, TcpException from netlib.http import http1, Headers from netlib.http import CONTENT_MISSING -from netlib.tcp import NetLibError, Address +from netlib.tcp import Address from netlib.http.http2.connections import HTTP2Protocol from netlib.http.http2.frame import GoAwayFrame, PriorityFrame, WindowUpdateFrame from .. import utils @@ -321,7 +321,7 @@ class HttpLayer(Layer): except HttpReadDisconnect: # don't throw an error for disconnects that happen before/between requests. return - except (HttpException, NetLibError) as e: + except (HttpException, TcpException) as e: self.send_error_response(400, repr(e)) six.reraise(ProtocolException, ProtocolException("Error in HTTP connection: %s" % repr(e)), sys.exc_info()[2]) @@ -358,7 +358,7 @@ class HttpLayer(Layer): self.handle_upstream_mode_connect(flow.request.copy()) return - except (HttpException, NetLibError) as e: + except (HttpException, TcpException) as e: self.send_error_response(502, repr(e)) if not flow.response: @@ -375,7 +375,7 @@ class HttpLayer(Layer): try: response = make_error_response(code, message) self.send_response(response) - except NetLibError: + except TcpException: pass def change_upstream_proxy_server(self, address): @@ -423,7 +423,7 @@ class HttpLayer(Layer): try: get_response() - except (tcp.NetLibError, HttpException) as v: + except (TcpException, HttpException) as v: self.log( "server communication error: %s" % repr(v), level="debug" |