package devkit

  1. Overview
  2. Docs

Dealing with exceptions

type 'a result = [
  1. | `Ok of 'a
  2. | `Exn of exn
]
val catch : ('a -> 'b) -> 'c -> 'd option
val default : 'a -> ('b -> 'c) -> 'd -> 'e
val suppress : ('a -> unit) -> 'b -> unit
val map : ('a -> 'b) -> 'c -> [> `Exn of exn | `Ok of 'b ]
val to_string : exn -> string
val str : exn -> string
val fail : ?exn:exn -> ('a, unit, string, 'b) format4 -> 'c
val invalid_arg : ('a, unit, string, 'b) format4 -> 'c
val get_backtrace : unit -> string list