summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2025-06-30 15:48:10 -0500
committerJohn Estabrook <jestabro@vyos.io>2025-07-06 18:27:40 -0500
commit9ac7c1e3a258c1e41c4c4abd7b45a8f29af7907a (patch)
treea90f02f02b9d32f404d4dd2991cd433bcca49407 /src
parent554ac72db109a04b2d53843bc75aa80965d22546 (diff)
downloadvyconf-9ac7c1e3a258c1e41c4c4abd7b45a8f29af7907a.tar.gz
vyconf-9ac7c1e3a258c1e41c4c4abd7b45a8f29af7907a.zip
T7499: catch Duplicate_value error
Diffstat (limited to 'src')
-rw-r--r--src/session.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/session.ml b/src/session.ml
index 5e276c2..1ff9bae 100644
--- a/src/session.ml
+++ b/src/session.ml
@@ -104,8 +104,12 @@ let set w s path =
apply_cfg_op op s.proposed_config |>
(fun c -> RT.set_tag_data w.reference_tree c path) |>
(fun c -> RT.set_leaf_data w.reference_tree c path)
- with CT.Useless_set ->
+ with
+ | CT.Useless_set ->
raise (Session_error (Printf.sprintf "Useless set, path: %s" (string_of_op op)))
+ | CT.Duplicate_value ->
+ raise (Session_error (Printf.sprintf "Duplicate value, path: %s" (string_of_op op)))
+
in
{s with proposed_config=config; changeset=(op :: s.changeset)}