Log exceptions in async notification handler

This commit is contained in:
Christoph M. Wintersteiger 2024-07-31 16:25:01 +01:00
parent 9a7e1c221c
commit 8123e95a5f
No known key found for this signature in database
GPG key ID: 50B5FDA31455CFF3

View file

@ -76,7 +76,10 @@ module Make (IO : IO) = struct
end end
let async (self : #base_server) f : unit IO.t = let async (self : #base_server) f : unit IO.t =
self#spawn_query_handler f; self#spawn_query_handler
(fun () -> try f () with err ->
Log.err (fun k -> k "LSP async notification handler failed: %s" (Printexc.to_string err));
IO.return ());
IO.return () IO.return ()
(** A wrapper to more easily reply to notifications *) (** A wrapper to more easily reply to notifications *)