Skip to content

Commit 7273a5e

Browse files
authored
Improve error message when regex doesn't match. (#184)
Point the user at the source of the regex. This would have saved me time when encountering the error in `riscof` which gave me no indication of what the actual problem was.
1 parent 0e0110c commit 7273a5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

riscv_config/schemaValidator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ def _check_with_capture_isa_specifics(self, field, value):
110110
self._error(field, "Invalid width in ISA.")
111111

112112
if not constants.isa_regex.match(value):
113-
self._error(field, 'Input ISA string does not match regex')
113+
self._error(field, 'Input ISA string %r does not match regex from %s' % (
114+
value, constants.__file__))
114115
if ext_err:
115116
for e in ext_err_list:
116117
self._error(field, e)

0 commit comments

Comments
 (0)