Skip to content

Commit

Permalink
Better regex parsing error message
Browse files Browse the repository at this point in the history
  • Loading branch information
buglloc committed May 19, 2017
1 parent 6f360bc commit ca0dca9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gixy/core/regexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,12 @@ def parsed(self):
if self._parsed:
return self._parsed

self._parsed = sre_parse.parse(FIX_NAMED_GROUPS_RE.sub('(?P<\\1>', self.source))
try:
self._parsed = sre_parse.parse(FIX_NAMED_GROUPS_RE.sub('(?P<\\1>', self.source))
except sre_parse.error as e:
LOG.fatal('Failed to parse regex: %s (%s)', self.source, str(e))
raise e

return self._parsed

def __str__(self):
Expand Down

0 comments on commit ca0dca9

Please sign in to comment.