Show error if compiling of an expression fails.
This commit is contained in:
parent
a5f87657e1
commit
72f8111f2b
|
@ -76,7 +76,7 @@ class _Rex(_Action):
|
||||||
try:
|
try:
|
||||||
self.re = re.compile(self.expr)
|
self.re = re.compile(self.expr)
|
||||||
except:
|
except:
|
||||||
self = None
|
raise ValueError, "Cannot compile expression."
|
||||||
|
|
||||||
def _check_content_type(expr, o):
|
def _check_content_type(expr, o):
|
||||||
val = o.headers.get("content-type")
|
val = o.headers.get("content-type")
|
||||||
|
@ -315,4 +315,6 @@ def parse(s):
|
||||||
return bnf.parseString(s, parseAll=True)[0]
|
return bnf.parseString(s, parseAll=True)[0]
|
||||||
except pp.ParseException:
|
except pp.ParseException:
|
||||||
return None
|
return None
|
||||||
|
except ValueError:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue