-
Notifications
You must be signed in to change notification settings - Fork 183
All *_s combinators of Lwt_react eat exceptions silently #1101
Copy link
Copy link
Open
Description
The E.*_s and S.*_s combinators all eat exceptions raised by the function-argument:
#!/usr/bin/env -S opam exec -- utop
#thread
#require "lwt"
#require "lwt.unix"
#require "lwt_react"
open Lwt.Syntax
open Lwt_react
let tick_e, tick_eupd = E.create ()
let tick_s = S.hold () tick_e
(*> Works*)
let e0 = tick_e |> E.map (fun _ -> failwith "error")
(*> No exception is printed - and program doesn't terminate*)
let e1 = tick_e |> E.map_s (fun _ -> failwith "error")
(*> Works*)
let e2 = tick_e |> E.map_p (fun _ -> failwith "error")
(*> No exception is printed - and program doesn't terminate*)
let e3 = tick_e |> E.fmap_s (fun _ -> failwith "error")
(*> No exception is printed - and program doesn't terminate*)
let s0 = tick_s |> S.map_s (fun _ -> failwith "error")
let rec feed_tick () = let* () = Lwt_unix.sleep 0.5 in tick_eupd (); feed_tick ()
let () = Lwt_main.run @@ loop () The exception is neither printed nor leading to program exit. From the source, this seems to be everywhere where Lwt_mutex.with_lock is used to wrap the given function
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels