From 72f8111f2bf5923ba974f59d6001cb595c17c607 Mon Sep 17 00:00:00 2001 From: Thomas Roth Date: Fri, 26 Feb 2010 17:48:55 +0100 Subject: [PATCH] Show error if compiling of an expression fails. --- libmproxy/filt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libmproxy/filt.py b/libmproxy/filt.py index 482ba74bb..87746f944 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