diff options
author | Thomas Roth <code@leveldown.de> | 2010-02-26 17:48:55 +0100 |
---|---|---|
committer | Thomas Roth <code@leveldown.de> | 2010-02-26 17:48:55 +0100 |
commit | 72f8111f2bf5923ba974f59d6001cb595c17c607 (patch) | |
tree | 992e33167220f2e931cf97d983c1ae2579d9d4af | |
parent | a5f87657e1c55a73513a1ab73e31c0870c4aec0f (diff) | |
download | mitmproxy-72f8111f2bf5923ba974f59d6001cb595c17c607.tar.gz mitmproxy-72f8111f2bf5923ba974f59d6001cb595c17c607.tar.bz2 mitmproxy-72f8111f2bf5923ba974f59d6001cb595c17c607.zip |
Show error if compiling of an expression fails.
-rw-r--r-- | libmproxy/filt.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libmproxy/filt.py b/libmproxy/filt.py index 482ba74b..87746f94 100644 --- a/libmproxy/filt.py +++ b/libmproxy/filt.py @@ -76,7 +76,7 @@ class _Rex(_Action): try: self.re = re.compile(self.expr) except: - self = None + raise ValueError, "Cannot compile expression." def _check_content_type(expr, o): val = o.headers.get("content-type") @@ -315,4 +315,6 @@ def parse(s): return bnf.parseString(s, parseAll=True)[0] except pp.ParseException: return None + except ValueError: + return None |