summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/session.ml9
1 files 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)}