error.ml1 2 3 4 5 6 7 8 9 10 11 12 13 14(** Errors returned by calls. *) type t = [ | `Exception of Exception.t | `Cancelled ] let pp f = function | `Exception ex -> Exception.pp f ex | `Cancelled -> Fmt.pf f "cancelled" let exn ?ty msg = msg |> Fmt.kstr @@ fun reason -> `Exception (Exception.v ?ty reason)