mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
add CCError.guard_str_trace
This commit is contained in:
parent
cba2d04049
commit
42c4c310b4
2 changed files with 9 additions and 0 deletions
|
|
@ -139,6 +139,10 @@ let guard_str f =
|
||||||
try `Ok (f())
|
try `Ok (f())
|
||||||
with e -> of_exn e
|
with e -> of_exn e
|
||||||
|
|
||||||
|
let guard_str_trace f =
|
||||||
|
try `Ok (f())
|
||||||
|
with e -> of_exn_trace e
|
||||||
|
|
||||||
let wrap1 f x =
|
let wrap1 f x =
|
||||||
try return (f x)
|
try return (f x)
|
||||||
with e -> `Error e
|
with e -> `Error e
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,11 @@ val guard_str : (unit -> 'a) -> ('a, string) t
|
||||||
(** Same as {!guard} but uses {!of_exn} to print the exception.
|
(** Same as {!guard} but uses {!of_exn} to print the exception.
|
||||||
See {!register_printer} *)
|
See {!register_printer} *)
|
||||||
|
|
||||||
|
val guard_str_trace : (unit -> 'a) -> ('a, string) t
|
||||||
|
(** Same as {!guard_str} but uses {!of_exn_trace} instead of {!of_exn} so
|
||||||
|
that the stack trace is printed.
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val wrap1 : ('a -> 'b) -> 'a -> ('b, exn) t
|
val wrap1 : ('a -> 'b) -> 'a -> ('b, exn) t
|
||||||
(** Same as {!guard} but gives the function one argument. *)
|
(** Same as {!guard} but gives the function one argument. *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue