diff options
| author | Emilio Jesus Gallego Arias | 2020-01-31 15:57:45 +0100 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2020-02-24 12:24:40 -0500 |
| commit | c216daf5d5f8215947bce10e55d30c35be1a56ba (patch) | |
| tree | d8b7eaf494bf01ee63d462d54ff85a67359f7c2a /lib/future.ml | |
| parent | 46fe9b26ad55a266b71bbd428ee406b03a9db030 (diff) | |
[exn] Forbid raising in exn printers, make them return Pp.t option
Raising inside exception printers is quite tricky as the order of
registration for printers will indeed depend on the linking order.
We thus forbid this, and make our API closer to the upstream
`Printexn` by having printers return an option type.
Diffstat (limited to 'lib/future.ml')
| -rw-r--r-- | lib/future.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/future.ml b/lib/future.ml index 5cccd2038d..ddf841b7fc 100644 --- a/lib/future.ml +++ b/lib/future.ml @@ -28,9 +28,9 @@ exception NotReady of string exception NotHere of string let _ = CErrors.register_handler (function - | NotReady name -> !not_ready_msg name - | NotHere name -> !not_here_msg name - | _ -> raise CErrors.Unhandled) + | NotReady name -> Some (!not_ready_msg name) + | NotHere name -> Some (!not_here_msg name) + | _ -> None) type fix_exn = Exninfo.iexn -> Exninfo.iexn let id x = x |
