diff options
author | Daniil Baturin <daniil@vyos.io> | 2023-01-27 18:36:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 18:36:45 +0000 |
commit | ae4b8eec0be649c298cd4eed8ec4bf43ca981725 (patch) | |
tree | 5883dfd2c8f64ab76f48ecd1cb70d0e80fbba0fc | |
parent | 71432f2eda8c33f761337aa95d4b98d02f2dcd79 (diff) | |
parent | 6944d7097d934a34691b0b2cac60aba196c3339b (diff) | |
download | vyos1x-config-ae4b8eec0be649c298cd4eed8ec4bf43ca981725.tar.gz vyos1x-config-ae4b8eec0be649c298cd4eed8ec4bf43ca981725.zip |
Merge pull request #12 from jestabro/insert_error
T4961: add name of offending node in exception Insert_error of string
-rw-r--r-- | src/vytree.ml | 3 |
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 |