Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (10 sloc) 354 Bytes
# let swallow_error () =
let monitor = Monitor.create () in
Stream.iter (Monitor.errors monitor) ~f:(fun _exn ->
printf "an error happened\n");
within' ~monitor (fun () ->
after (Time.Span.of_sec 0.5) >>= fun () -> failwith "Kaboom!")
;;
val swallow_error : unit -> 'a Deferred.t = <fun>
# swallow_error ();;
an error happened