caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Lwt and exceptions (2015)
@ 2015-07-07  5:40 Mike Lin
  2015-07-13 20:01 ` Andreas Hauptmann
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Lin @ 2015-07-07  5:40 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

Dear all,
I've long been observing the admonishment to avoid raising native exceptions in Lwt code [1,2]. However, it has not escaped my notice that between Lwt.catch, the try%lwt syntax extension, and the fact that Lwt.bind sets up a handler for native exceptions raised in asynchronous callbacks [3], they're usually handled just as one would naively expect. Actually, I spent a little time trying to come up with a non-terribly-contrived example where using a native exception breaks the intended handling logic, and did not succeed...
Perhaps the situation has evolved over time as some of the aforementioned features have been added to Lwt. Can anyone venture to define precisely when it's wrong to raise native exceptions in Lwt code, as of 2015?
[1] https://mirage.io/wiki/tutorial-lwt[2] http://caml-list.inria.narkive.com/YRIVPWeD/lwt-and-exceptions[3] https://github.com/ocsigen/lwt/blob/bb75e9185e2cf9a71d13b5008d08dae8fdc90f4d/src/core/lwt.ml#L653
Mike
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 1341 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-13 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-07  5:40 [Caml-list] Lwt and exceptions (2015) Mike Lin
2015-07-13 20:01 ` Andreas Hauptmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).