package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a
doc/octez-libs.lwt-result-stdlib/Tezos_lwt_result_stdlib/Lwtreslib/Bare/Unit/index.html
Module Bare.Unit
Source
val unit : t
val to_string : t -> string
catch f
is f ()
, but exceptions are ignored and ()
is returned if one is raised.
You should only use catch
when you truly do not care about what exception may be raised during the evaluation of f ()
. If you need to inspect the raised exception consider catch_f
and if you need to pass it along consider Result.catch
.
If catch_only
is set, then only exceptions e
such that catch_only e
is true
are caught.
Whether catch_only
is set or not, this function never catches non-deterministic runtime exceptions of OCaml such as Stack_overflow
and Out_of_memory
.
catch_f f handler
is f ()
. If f ()
raises an exception then handler
is called.
No attempt is made to catch the exceptions raised by handler
.
catch_only
has the same behaviour and limitations as with catch
.