clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
216 stars 71 forks source link

"error-message" customization within "must" statement #507

Open EvgeniiVR opened 6 months ago

EvgeniiVR commented 6 months ago

Hello team, Does clixon have an option to customize "error-message" that is used within "must" statement directly in yang model? If there are a lot of entities within a list it becomes difficult to catch one which causes the problem.

Let's say we have a simple list model, e.g.:

{
 container c1 {
   list L1 {
     key name;
     leaf name {
       type string;
     }
     leaf l2 {
       must "Some expression" {
         error-message "Some message";
       }
       type string;
      }
    }
  }
}

So the idea is somehow to customize error-message and enrich it with exact entity name where error occures, like in 'printf' style: error-message ("%s Some message", ../name)

olofhagsand commented 6 months ago

No there is no such customization. Sounds like a relatively straightforward extension.