From f6653abbc5d4a5229fafa49d49bf517f6baada33 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 10 Apr 2025 20:28:20 -0500 Subject: T7321: catch Useless_set exception --- src/session.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/session.ml b/src/session.ml index c1f0bcc..24a8153 100644 --- a/src/session.ml +++ b/src/session.ml @@ -95,9 +95,12 @@ let set w s path = let value_behaviour = if RT.is_multi w.reference_tree refpath then CT.AddValue else CT.ReplaceValue in let op = CfgSet (path, value, value_behaviour) in let config = - 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) + try + 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 -> + raise (Session_error (Printf.sprintf "Useless set, path: %s" (string_of_op op))) in {s with proposed_config=config; changeset=(op :: s.changeset)} -- cgit v1.2.3