From 026330a3b014f24f095b839b29186036854de3bc Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 8 Aug 2015 16:08:57 +0200 Subject: cleaner Exceptions, ssl -> tls, upstream proxy mode --- libmproxy/exceptions.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 libmproxy/exceptions.py (limited to 'libmproxy/exceptions.py') diff --git a/libmproxy/exceptions.py b/libmproxy/exceptions.py new file mode 100644 index 00000000..4d98c024 --- /dev/null +++ b/libmproxy/exceptions.py @@ -0,0 +1,22 @@ +from __future__ import (absolute_import, print_function, division) + + +class ProxyException(Exception): + """ + Base class for all exceptions thrown by libmproxy. + """ + def __init__(self, message, cause=None): + """ + :param message: Error Message + :param cause: Exception object that caused this exception to be thrown. + """ + super(ProxyException, self).__init__(message) + self.cause = cause + + +class ProtocolException(ProxyException): + pass + + +class ServerException(ProxyException): + pass \ No newline at end of file -- cgit v1.2.3 From aef3b626a70de5f385c8f5496c2e49575b5c3e1c Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 11 Aug 2015 20:27:34 +0200 Subject: wip commit --- libmproxy/exceptions.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libmproxy/exceptions.py') diff --git a/libmproxy/exceptions.py b/libmproxy/exceptions.py index 4d98c024..3825c409 100644 --- a/libmproxy/exceptions.py +++ b/libmproxy/exceptions.py @@ -18,5 +18,13 @@ class ProtocolException(ProxyException): pass +class HttpException(ProtocolException): + pass + + +class InvalidCredentials(HttpException): + pass + + class ServerException(ProxyException): - pass \ No newline at end of file + pass -- cgit v1.2.3 From dd7f50d64bef38fa67b4cace91913d03691dde26 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 30 Aug 2015 01:21:58 +0200 Subject: restructure code, remove cruft --- libmproxy/exceptions.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libmproxy/exceptions.py') diff --git a/libmproxy/exceptions.py b/libmproxy/exceptions.py index 3825c409..f34d9707 100644 --- a/libmproxy/exceptions.py +++ b/libmproxy/exceptions.py @@ -18,6 +18,10 @@ class ProtocolException(ProxyException): pass +class Socks5Exception(ProtocolException): + pass + + class HttpException(ProtocolException): pass -- cgit v1.2.3