Displaying error message when user tries to delete something that doesnt exist in DB

When a user tries to delete something that doesnt exist in the database, confd displays a message that says “No Modifications made to the database”.
Instead how can I trigger a more meaningful error message onto the console?

Refer to the following Tail-f YANG CLI extension:

tailf:cli-suppress-silent-no value

Specifies that the confd.conf directive cSilentNo should
be suppressed for a leaf and that a custom error message
should be displayed when the user attempts to delete a
non-existing element.

Used in I- and C-style CLIs.

The cli-suppress-silent-no statement can be used in: leaf,
leaf-list, list, tailf:symlink, container, and refine.
1 Like

I added cli-suppress-silent-no as below:

  list vlan-map {
      tailf:display-when "/link/mode = 'differentiated' and /link/cos-classifier = 'vid'";
      key cos;
      tailf:info "Map vlan range to cos";
      tailf:cli-suppress-silent-no "Specified map doesnt exist";

      leaf cos {
          type cndlp-types:cndlp-cos-id;
          tailf:info "cos (0..7)";
      }
     leaf-list vid {
          tailf:info "range of vlan-ids (separated by ,or-)";
          tailf:cli-range-list-syntax;
          tailf:cli-suppress-silent-no "Specified vid doesnt exist";

          type union {
              type int16 {
                  tailf:info "vlan id <2-4094>";
                  range "2..4094";
              }
              type string {
                  tailf:info "range of vlan id separated by either '-' or ','";
                  pattern "(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[2-9](-409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[2-9])?(,409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[2-9](-409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[2-9])?)*)";
              }
          }
      }
  }

However, I dont see that message when I try to delete with some other value. Am I missing something?

root@cavium-thunderx 20:59:06% set link vlan-map 0 vid 100
[ok][2018-02-20 20:59:16]

[edit]
root@cavium-thunderx 20:59:16% commit
Commit complete.
[ok][2018-02-20 20:59:18]

[edit]
root@cavium-thunderx 20:59:18% delete link vlan-map 0 vid 10
[ok][2018-02-20 20:59:31]

[edit]
root@cavium-thunderx 20:59:31% commit
No modifications to commit.
[ok][2018-02-20 20:59:33]

[edit]