package core_extended

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include module type of struct include Core.Exn end
type t = exn
val sexp_of_t : t -> Base__.Sexplib.Sexp.t
val pp : Base__.Import.Caml.Format.formatter -> t -> unit
exception Finally of t * t
exception Reraised of string * t
val create_s : Base__.Sexp.t -> t
val raise_without_backtrace : t -> 'a
val reraise : t -> string -> 'a
val reraisef : t -> ('a, unit, string, unit -> 'b) Pervasives.format4 -> 'a
val to_string_mach : t -> string
val protectx : f:('a -> 'b) -> 'a -> finally:('a -> unit) -> 'b
val protect : f:(unit -> 'a) -> finally:(unit -> unit) -> 'a
val handle_uncaught : exit:bool -> (unit -> unit) -> unit
val handle_uncaught_and_exit : (unit -> 'a) -> 'a
val reraise_uncaught : string -> (unit -> 'a) -> 'a
val does_raise : (unit -> 'a) -> bool
val initialize_module : unit -> unit
module Private : sig ... end
include module type of struct include Extended_exn end
val to_string : exn -> string

The to_string function is slightly tweaked to avoid escaping the string content of Failure.

val to_string_hum : exn -> string

This is also an ever so slight variation of to_string target more at user than developers (Failure s is just printed as s)

val unwrap : exn -> exn

unwrap e

Tries to unwrap an exception to find the original cause of the error (Finally for instance has the propency to burry exception...). This is useful when matching on exceptions.

module Exn_string = Extended_exn.Exn_string

The point of this module is to be able to include an exn in a type that has to be sexpable or binable. The Exn_string.t type is more descriptive than just converting to a string and is guaranteed to have come from an exn (unless someone abuses the t_of_sexp function or something).

OCaml

Innovation. Community. Security.