Skip to content

Commit 032b120

Browse files
Improve documentation
1 parent f4da930 commit 032b120

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
====== Additions ======
2020

21-
* Lwt.set_exception_filter for enabling/disabling system-exception catching (#964)
21+
* Lwt.Exception_filter for enabling/disabling system-exception catching (#964)
2222
* Lwt.reraise an exception raising function which preserves backtraces, recommended for use in Lwt.catch (#963)
2323
* Expose Lwt_io.delete_recursively for deleting a directory and its content recursively. (#984, Antonin Décimo)
2424

src/core/lwt.mli

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,10 +2025,17 @@ module Exception_filter: sig
20252025

20262026
(** [handle_all_except_runtime] is a filter which lets the OCaml runtime
20272027
exceptions ([Out_of_memory] and [Stack_overflow]) go through all the Lwt
2028-
abstractions and bubble all the way out of the call to [Lwt_main.run]. *)
2028+
abstractions and bubble all the way out of the call to [Lwt_main.run].
2029+
2030+
Note that if you set this handler, then the runtime exceptions leave the
2031+
Lwt internal state inconsistent. For this reason, you will not be able to
2032+
call [Lwt_main.run] again after such an exception has escaped
2033+
[Lwt_main.run]. *)
20292034
val handle_all_except_runtime : t
20302035

2031-
(** [set] sets the given exception filter globally. *)
2036+
(** [set] sets the given exception filter globally. You should call this
2037+
function at most once during the start of your program, before the
2038+
first call to [Lwt_main.run]. *)
20322039
val set : t -> unit
20332040

20342041
(**/**)

0 commit comments

Comments
 (0)