Install a pretty printer for the Fun.Finally_raised exception (#9266)
parent
2208a4cbe6
commit
b1fdc44547
4
Changes
4
Changes
|
@ -119,6 +119,10 @@ Working version
|
|||
- #9365: Set.filter_map and Map.filter_map
|
||||
(Gabriel Scherer, review by Stephen Dolan and Nicolás Ojeda Bär)
|
||||
|
||||
- #9266: Install pretty-printer for the exception Fun.Finally_raised.
|
||||
(Guillaume Munch-Maccagnoni, review by Daniel Bünzli, Gabriel Radanne,
|
||||
and Gabriel Scherer)
|
||||
|
||||
### Other libraries:
|
||||
|
||||
- #9106: Register printer for Unix_error in win32unix, as in unix.
|
||||
|
|
|
@ -20,6 +20,10 @@ let negate p v = not (p v)
|
|||
|
||||
exception Finally_raised of exn
|
||||
|
||||
let () = Printexc.register_printer @@ function
|
||||
| Finally_raised exn -> Some ("Fun.Finally_raised: " ^ Printexc.to_string exn)
|
||||
| _ -> None
|
||||
|
||||
let protect ~(finally : unit -> unit) work =
|
||||
let finally_no_exn () =
|
||||
try finally () with e ->
|
||||
|
|
Loading…
Reference in New Issue