diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-03-09 21:13:08 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-03-09 21:13:08 +0100 |
commit | fc4fe83eafc68ebb9763fa5cbee1ed7e16964c9c (patch) | |
tree | bffc95a421a5b885efd16cd77af7c4e1ad7d023d /libmproxy/prxy/exception.py | |
parent | 2e50b1073538730fc5bd6369e2cb8176874f2f03 (diff) | |
download | mitmproxy-fc4fe83eafc68ebb9763fa5cbee1ed7e16964c9c.tar.gz mitmproxy-fc4fe83eafc68ebb9763fa5cbee1ed7e16964c9c.tar.bz2 mitmproxy-fc4fe83eafc68ebb9763fa5cbee1ed7e16964c9c.zip |
split up proxy.py
Diffstat (limited to 'libmproxy/prxy/exception.py')
-rw-r--r-- | libmproxy/prxy/exception.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libmproxy/prxy/exception.py b/libmproxy/prxy/exception.py new file mode 100644 index 00000000..c43a5d75 --- /dev/null +++ b/libmproxy/prxy/exception.py @@ -0,0 +1,14 @@ +class ProxyError(Exception): + def __init__(self, code, msg, headers=None): + self.code, self.msg, self.headers = code, msg, headers + + def __str__(self): + return "ProxyError(%s, %s)" % (self.code, self.msg) + + +class ConnectionTypeChange(Exception): + """ + Gets raised if the connection type has been changed (e.g. after HTTP/1.1 101 Switching Protocols). + It's up to the raising ProtocolHandler to specify the new conntype before raising the exception. + """ + pass
\ No newline at end of file |