[YANGTOOLS-736] Bad error message for pattern constraint Created: 16/Jan/17  Updated: 10/Apr/22  Resolved: 27/Jan/17

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Peter Verthez Assignee: Peter Kajsa
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 7551
Priority: Low

 Description   

The error message that the YANG parser associates with a pattern (in PatternConstraintImpl) is:

this.errorMessage = errorMessage != null ? errorMessage : String.format(
"String %s is not valid regular expression.", regex);

This is a misleading error message: it is not the regular expression that is invalid, but the given value: that value does not match the regular expression, and so the value is invalid.

This error message should be corrected.



 Comments   
Comment by Peter Kajsa [ 17/Jan/17 ]

https://git.opendaylight.org/gerrit/#/c/50543/

Generated at Wed Feb 07 20:54:09 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.