Go to the first, previous, next, last section, table of contents.


The Printexc2 module

val register_exn : (exn -> string) -> unit

register_exn printer registers a printer for user-defined exceptions. printer is a function which takes an exception as argument and converts it to a string. If it cannot convert the exception, it should raise it again.

val catchexn : string -> (unit -> unit) -> unit

catchexn msg f executes the function f and returns unit. If an exception is raised during the execution of f, the message msg is printed on standard output with the exception using printexn, and unit is returned.

val vcatchexn : string -> (unit -> 'a) -> 'a option

vcatchexn msg f executes the function f and returns (Some v) if v is the value returned by f. If an exception is raised during the execution of f, the message is printed on standard output with the exception using printexn, and None is returned.


Go to the first, previous, next, last section, table of contents.