fix
This commit is contained in:
parent
0dd0511581
commit
b80929774a
|
@ -88,12 +88,15 @@ let ( >>= ) t f =
|
||||||
let ( >>| ) t f = t >>= fun x -> return (f x)
|
let ( >>| ) t f = t >>= fun x -> return (f x)
|
||||||
|
|
||||||
let with_exn_handler f ~handler =
|
let with_exn_handler f ~handler =
|
||||||
protectx !exn_handler
|
let saved = !exn_handler in
|
||||||
~finally:(fun saved ->
|
exn_handler := handler;
|
||||||
exn_handler := saved)
|
match f () with
|
||||||
~f:(fun _ ->
|
| x -> exn_handler := saved; x
|
||||||
exn_handler := handler;
|
| exception exn ->
|
||||||
f ())
|
let bt = Printexc.get_raw_backtrace () in
|
||||||
|
exn_handler := saved;
|
||||||
|
handler exn bt;
|
||||||
|
reraise exn
|
||||||
|
|
||||||
let both a b =
|
let both a b =
|
||||||
a >>= fun a ->
|
a >>= fun a ->
|
||||||
|
|
Loading…
Reference in New Issue