summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-05-31 15:07:22 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-05-31 15:51:49 -0500
commit664748170e4990cc46b77f44354ea028c2f92f1f (patch)
tree398f9a23c705b8cdeddbf8d447f5e58019d36429
parentec930f944a730571cad9e5a2d4108821116a68ba (diff)
downloadlibvyosconfig-664748170e4990cc46b77f44354ea028c2f92f1f.tar.gz
libvyosconfig-664748170e4990cc46b77f44354ea028c2f92f1f.zip
T5251: catch error Vytree.Nonexistent_path in delete_value
-rw-r--r--lib/bindings.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bindings.ml b/lib/bindings.ml
index 965d84f..6ab7aeb 100644
--- a/lib/bindings.ml
+++ b/lib/bindings.ml
@@ -85,7 +85,9 @@ let delete_value c_ptr path value =
let new_ct = CT.delete ct path (Some value) in
Root.set c_ptr new_ct;
0 (* return 0 *)
- with CT.No_such_value -> 1
+ with
+ | Vytree.Nonexistent_path -> 1
+ | CT.No_such_value -> 2
let delete_node c_ptr path =
let ct = Root.get c_ptr in