summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-01-27 09:37:46 -0600
committerJohn Estabrook <jestabro@vyos.io>2023-01-27 10:53:23 -0600
commit6944d7097d934a34691b0b2cac60aba196c3339b (patch)
tree5883dfd2c8f64ab76f48ecd1cb70d0e80fbba0fc
parent71432f2eda8c33f761337aa95d4b98d02f2dcd79 (diff)
downloadvyos1x-config-6944d7097d934a34691b0b2cac60aba196c3339b.tar.gz
vyos1x-config-6944d7097d934a34691b0b2cac60aba196c3339b.zip
T4961: add name of offending node in exception Insert_error of string
-rw-r--r--src/vytree.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vytree.ml b/src/vytree.ml
index a3e2750..cda12f0 100644
--- a/src/vytree.ml
+++ b/src/vytree.ml
@@ -83,7 +83,8 @@ let rec insert ?(position=Default) ?(children=[]) node path data =
let new_node = insert ~position:position ~children:children next_child' names data in
replace node new_node
| None ->
- raise (Insert_error "Path does not exist")
+ let s = Printf.sprintf "Non-existent intermediary node: \'%s\'" name in
+ raise (Insert_error s)
(** Given a node N check if it has children with duplicate names,
and merge subsequent children's children into the first child by