Commit 16a0e2e5 authored by Igor Dejanovic's avatar Igor Dejanovic

Rule may override explanation message in NoMatch

parent 7fae479f
......@@ -64,7 +64,10 @@ class NoMatch(Exception):
self.exp_str = exp_str
if not exp_str:
if self.rule.root:
if hasattr(self.rule, '_exp_str'):
# Rule may override error message
self.exp_str = self.rule._exp_str
elif self.rule.root:
self.exp_str = rule.rule_name
elif isinstance(self.rule, Match):
self.exp_str = rule.to_match
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment