aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/future.ml8
-rw-r--r--toplevel/stm.ml3
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/future.ml b/lib/future.ml
index a9a5ee588..292fd6648 100644
--- a/lib/future.ml
+++ b/lib/future.ml
@@ -74,9 +74,11 @@ let compute ~pure c : 'a value = match !c with
let data = f () in
let state = if pure then None else Some (!freeze ()) in
c := Val (data, state); `Val data
- with
- | NotReady as e -> let e = Errors.push e in `Exn e
- | e -> let e = Errors.push e in c := Exn e; `Exn e
+ with e ->
+ let e = Errors.push e in
+ match e with
+ | NotReady -> `Exn e
+ | _ -> c := Exn e; `Exn e
let force ~pure x = match compute ~pure x with
| `Val v -> v
diff --git a/toplevel/stm.ml b/toplevel/stm.ml
index 52a5bd496..d72b1fd2f 100644
--- a/toplevel/stm.ml
+++ b/toplevel/stm.ml
@@ -454,7 +454,6 @@ end = struct (* {{{ *)
let freeze marhallable id = VCS.set_state id (freeze_global_state marhallable)
let exn_on id ?valid e =
- let e = Errors.push e in
let loc = Option.default Loc.ghost (Loc.get_loc e) in
let msg = string_of_ppcmds (print e) in
Pp.feedback ~state_id:id (Interface.ErrorMsg (loc, msg));
@@ -1129,6 +1128,7 @@ let process_transaction verbosely (loc, expr) =
prerr_endline "executed }}}";
VCS.print ()
with e ->
+ let e = Errors.push e in
match Stateid.get_state_id e with
| None ->
VCS.restore vcs;
@@ -1136,7 +1136,6 @@ let process_transaction verbosely (loc, expr) =
anomaly (str ("execute: "^
string_of_ppcmds (Errors.print_no_report e) ^ "}}}"))
| Some (_, id) ->
- let e = Errors.push e in
prerr_endline ("Failed at state " ^ Stateid.string_of_state_id id);
VCS.restore vcs;
VCS.print ();