package devkit

  1. Overview
  2. Docs

Dealing with exceptions

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

Innovation. Community. Security.