mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-28 20:24:59 +08:00
Show error if compiling of an expression fails.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user